Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
Newcomer to the thread... I have a question regarding rereleases of old games, so I'm not sure if anyone here has console experience.

Company decides to port/rerelease a game, how many of the original assets do they still have and what does it look like where there is new code to be added next to old code? Examples, like Chrono Trigger vs Chrono Trigger DS. Or the new Marvel vs Capcom 2. I ask because I know some releases they don't even bother making fixes; they just emulate.

Adbot
ADBOT LOVES YOU

Vinterstum
Jul 30, 2003

Triple Tech posted:

Newcomer to the thread... I have a question regarding rereleases of old games, so I'm not sure if anyone here has console experience.

Company decides to port/rerelease a game, how many of the original assets do they still have and what does it look like where there is new code to be added next to old code? Examples, like Chrono Trigger vs Chrono Trigger DS. Or the new Marvel vs Capcom 2. I ask because I know some releases they don't even bother making fixes; they just emulate.

Say again? I find it a bit hard to understand what you're asking about here. The company will probably have all the original assets already (assuming they have the rights for the game and the original source material), they just need to port the platform-dependent code to the new platform (i.e. routines for graphics, sound, input). For 2D games with the kind of system requirements like Chrono Trigger it would make little sense to emulate, it should be a reasonably straightforward porting job.

Vinterstum fucked around with this message at 21:59 on May 1, 2009

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Vinterstum posted:

For 2D games with the kind of system requirements like Chrono Trigger it would make little sense to emulate, it should be a reasonably straightforward porting job.
If I'm not mistaken, the PS1 releases of Squaresoft SNES RPGs were simply emulated. That was probably just an attempt to cash in on existing games with a minimal amount of work on their part, though.

POKEMAN SAM
Jul 8, 2004

Dijkstracula posted:

If I'm not mistaken, the PS1 releases of Squaresoft SNES RPGs were simply emulated. That was probably just an attempt to cash in on existing games with a minimal amount of work on their part, though.

Chrono Trigger was also released for the DS, with new features, which is interesting.

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
I guess I have this twisted view of game development... That the platforms (before multi-platform releases were in vogue) were so insanely complex that you wrote to the metal. So the idea of porting to a different platform is this crazy complex horrible to-do. No? Like, programmers would not do their due diligence of making their code cross platform because there was no initial need to. Now that there is, how big of a hassle is it to fix bugs, add features, rip out certain subsystems and keep others. I guess I'm assuming game development is this vast wasteland of code completely void of cleanliness and extensibility.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Like all subfields of software development, not all projects in game development are created the same way.

Vinterstum
Jul 30, 2003

Triple Tech posted:

I guess I have this twisted view of game development... That the platforms (before multi-platform releases were in vogue) were so insanely complex that you wrote to the metal. So the idea of porting to a different platform is this crazy complex horrible to-do. No? Like, programmers would not do their due diligence of making their code cross platform because there was no initial need to. Now that there is, how big of a hassle is it to fix bugs, add features, rip out certain subsystems and keep others. I guess I'm assuming game development is this vast wasteland of code completely void of cleanliness and extensibility.

Besides the platform-specific stuff (interacting with system APIs), this would only apply for things like handcoded assembly. And even back then multiplatform work was common enough that this would most likely only have been done for very specific things (like blitting routines, for example) when needed. Not to mention that writing much more than that in assembly would just add way too much development time.

But as AD says, I'm sure there's plenty of examples to the contrary. And this is just the impression I get from talking to old industry fogies, I'm sure I could be wrong :).

Vinlaen
Feb 19, 2008

How is XNA looking now-a-days? I see that it keeps getting updated and a new version is coming soon (v3.1) which is really great and I'm thrilled that Microsoft has such a dedication to it.

In the past I didn't want to use XNA because I wanted to develop Windows games that didn't have a difficult installation process requiring several different runtimes but it looks like Microsoft fixed the problem with Click-Once installation so I'm not quite as turned off from it as I used to be.

Anyways, is XNA still the best thing for somebody who just wants to create a game without worrying about much of the low-level details?

For example, I'm also thinking about using OpenTk (eg. OpenGL for C#) but it seems like if I'm using .NET (which I'm definitely going to use) than I might as well use XNA.

Drox
Aug 9, 2007

by Y Kant Ozma Post
A friend of mine who is going to school for game design is coming home for the summer and wants to get me back into programming with XNA. I'm doing my best to get started on my own, so I come to you for help.

Are there any good books for C# or (especially) XNA? I've done some programming before, mostly BASIC with a little Java, but it's been years since, so I'd probably be best going for something aimed at beginners.

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

Drox posted:

A friend of mine who is going to school for game design is coming home for the summer and wants to get me back into programming with XNA. I'm doing my best to get started on my own, so I come to you for help.

Are there any good books for C# or (especially) XNA? I've done some programming before, mostly BASIC with a little Java, but it's been years since, so I'd probably be best going for something aimed at beginners.

Learning XNA 3.0 by Aaron Reed is pretty good. Covers all topics. 2D, Zune deployment, 3D, 360 deployment, etc. It's well done. I'd go so far as to say it's the best XNA book right now.

Cynicide
Jun 13, 2002

Born from a wish

SAHChandler posted:

Learning XNA 3.0 by Aaron Reed is pretty good. Covers all topics. 2D, Zune deployment, 3D, 360 deployment, etc. It's well done. I'd go so far as to say it's the best XNA book right now.

I'd echo this, if you have experience in another class based language you can probably dive into it without much background on C# but it helps if you do.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Cynicide posted:

class based language

It's "object-oriented".

Cynicide
Jun 13, 2002

Born from a wish

Avenging Dentist posted:

It's "object-oriented".

Sorry, I'm not a programmer, I just pretend every now and then :(

Axel Rhodes Scholar
May 12, 2001

Courage Reactor

Avenging Dentist posted:

It's "object-oriented".

Not necessarily.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

dazjw posted:

Not necessarily.

Today's zen koan: does a paradigm in a language that no one uses truly "exist"?

pseudorandom name
May 6, 2007

Avenging Dentist posted:

Today's zen koan: does a paradigm in a language that no one uses truly "exist"?

Moot point. People may not use Self, but they certainly use JavaScript.

Morpheus
Apr 18, 2008

My favourite little monsters
So this is in the category of things that likely have a simple solution, but I can't really think of one:

I'm doing some simple game programming by making a really simple asteroids game, something that I can finish and add polish to and create a full product etc.

The only thing I'm having trouble with is figuring out is when object are on the edge of the screen, and so must be drawn on both sides of the screen. For each object that's on an edge, I imagine that it must be drawn twice (or four times, if it's on a corner). Is this right? There's also the problem of collision checking, because this way would have a number of checks just to check collisions with one object. I'm sure there's a better way for this.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Rendering is easy: just check if the bounding box of your object intersects with the lines representing each edge of the screen. If it intersects a given edge, you have to draw it on the opposite side as well. If it intersects two edges, you have to draw it on two opposite sides plus an opposite corner.

You can use these rendering checks to also tell when you need to perform more complicated collision detection. Or you can treat the coordinates as integers mod N. (The easiest is to set N = 2^32*.)

* Technically 2^(sizeof(int)*8)

FSMC
Apr 27, 2003
I love to live this lie
What the best way to make units for different teams? Say I want to use the same unit but want a blue version and a red version to differentiate between the different players. Currently they are just a square with a texture drawn onto it.

1. Do I draw 2 identical sprites/textures but just color them differently.
Pros. It'll work.
Cons. may take up too much space in terms of textures. (I wanted to have a single 1024^2 texture with everything on it).

2. Use opengl ES to color the same sprite/texture to make them it red or blue.
Pros. Don't have to have lots of repeated units just a different color.
Cons. Not really sure how to color the clothes but leave the face the same color, etc.

3. Suggestions.

How is this usually done?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Make a mask for the colorable areas and then use your favorite texture blending methods to render.

supster
Sep 26, 2003

I'M TOO FUCKING STUPID
TO READ A SIMPLE GRAPH

Avenging Dentist posted:

Make a mask for the colorable areas and then use your favorite texture blending methods to render.
Wouldn't the texture mask still need to be the same size as the texture, therefore not saving him any space any memory in terms of texture usage?

Star Warrior X
Jul 14, 2004

supster posted:

Wouldn't the texture mask still need to be the same size as the texture, therefore not saving him any space any memory in terms of texture usage?

Yes, but you only need one mask, and can then have as many colors as you want, so it saves for any number of colors greater than 2.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

supster posted:

Wouldn't the texture mask still need to be the same size as the texture, therefore not saving him any space any memory in terms of texture usage?

Also keep in mind that at 1024x1024 pixels, a 32-bit image is a whopping 4 MB. For reference, the original XBox had 64 MB of memory, and most relatively recent PC graphics cards have at least 256 MB.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
If it's not translucent, you could use the alpha channel, which works better with texture compression.

supster posted:

Wouldn't the texture mask still need to be the same size as the texture, therefore not saving him any space any memory in terms of texture usage?
There's nothing stopping you from using two textures of different resolution on the same surface.

OneEightHundred fucked around with this message at 23:06 on May 12, 2009

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

Avenging Dentist posted:

Make a mask for the colorable areas and then use your favorite texture blending methods to render.

Systems I've written in the past do exactly this (it actually used another 4 channel texture -- two channels of Diffuse Tint Mask, and two channels of Specular Tint masks). You can do a multiplicative modulation, a linear blend, or something more sophisticated convert the texel into HSV space, keep the V-level and blend the Hue and Saturation.

Cynicide
Jun 13, 2002

Born from a wish
Just a quick Python question that I can't seem to find via Google.

Does anyone know how to make a pyglet window something other than black? I've gone through the api documentation for it at http://www.pyglet.org/doc/api/pyglet.window.Window-class.html and nothing seems to jump out.

Benji the Blade
Jun 22, 2004
Plate of shrimp.
Assuming you're looking to set the background of the contents of your pyglet window (that is, draw the background of your OpenGL context a certain color), see glClearColor and glClear which can both be found in pyglet.gl.

Vinlaen
Feb 19, 2008

Does anybody know of any 3D tiling engines?

I'd like to create something like Final Fantasy Tactics (or Disgaea, etc)...

I've started writing my own in XNA and it's coming along decently but it's very, very slow even with my optimized (which probably isn't very) terrain structure. (eg. I'm creating one single batch of triangles that contains the entire terrain so than I only need one DrawIndexedPrimitives call to the graphics card).

Cynicide
Jun 13, 2002

Born from a wish

Benji the Blade posted:

Assuming you're looking to set the background of the contents of your pyglet window (that is, draw the background of your OpenGL context a certain color), see glClearColor and glClear which can both be found in pyglet.gl.

Thanks, worked a treat.

Vinterstum
Jul 30, 2003

Vinlaen posted:

Does anybody know of any 3D tiling engines?

I'd like to create something like Final Fantasy Tactics (or Disgaea, etc)...

I've started writing my own in XNA and it's coming along decently but it's very, very slow even with my optimized (which probably isn't very) terrain structure. (eg. I'm creating one single batch of triangles that contains the entire terrain so than I only need one DrawIndexedPrimitives call to the graphics card).

Assuming the terrain covers more than one screen, then that's not very optimized at all. Just think: The larger you make your world, the slower your rendering will become, even though you're still looking at the exact same -piece- of it.

Try dividing your terrain into chunks (N by M tiles) and use some kind of spatial partitioning scheme and/or frustrum culling to draw just what you need.

shodanjr_gr
Nov 20, 2007

Vinterstum posted:

Try dividing your terrain into chunks (N by M tiles) and use some kind of spatial partitioning scheme and/or frustrum culling to draw just what you need.

This.

Alternatively (or complimentary) to the above, you can use bounding boxes + occlusion queries to figure out of a given tile (or group of tiles, along with everything lying on them) needs to be rendered.

You can also toy around with the order of rendering things in order to reduce overdraw.

Actually this issue has come up a couple of times before, both in this thread and in the Graphics Questions Megathread, so you can try looking there as well.

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

Vinterstum posted:

Assuming the terrain covers more than one screen, then that's not very optimized at all. Just think: The larger you make your world, the slower your rendering will become, even though you're still looking at the exact same -piece- of it.

Try dividing your terrain into chunks (N by M tiles) and use some kind of spatial partitioning scheme and/or frustrum culling to draw just what you need.

I'd be highly surprised if the GPU pipeline (and not API/driver overhead) was the bottleneck in his performance. Then again, it depends on how big his terrain is and how complex the rest of the scene is.

Tiling (as suggested) is probably the best easy solution, but I'd try commenting out your terrain and seeing how perf changes first. Premature optimization is the Devil.

QuantumPotato
Feb 3, 2005

Fallen Rib
Anyone here got a lot of experience with Direct X?

I'm writing a 2D platformer, the levels are built using a Tile Map, pretty standard stuff. I was wondering however, what the best method to optimize the levels is. The Tile map will never change once its drawn to the screen, but all my attempts to draw it into a single D3DX texture seems to work, but when I draw the texture to the screen, it gets stretched. I'm pretty new to directX at this point, so I've got no idea whats going on.

heres the code that renders the level. Anything with the prefix CSGD is a wrapper to handle the DX functions.
code:
LPDIRECT3DTEXTURE9 CLevel::Render()
{
	//Create Texture to Render to
	LPDIRECT3DTEXTURE9 m_pRenderTarget;
	int a = GetLayerWidth() * GetTileWidth();
	int b = GetLayerHeight() * GetTileHeight();

	HRESULT hr = CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->CreateTexture(a, b, 1, 0,
		D3DFMT_A8R8G8B8,D3DPOOL_MANAGED, &m_pRenderTarget, NULL);

	CSGD_Direct3D::GetInstance()->DeviceBegin();
	CSGD_Direct3D::GetInstance()->SpriteBegin();

	LPDIRECT3DSURFACE9		m_pBackbuffer;	
	CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->GetRenderTarget(0,&m_pBackbuffer);

	//	Set the render target.
	LPDIRECT3DSURFACE9 pSurface = NULL;
	m_pRenderTarget->GetSurfaceLevel(0, &pSurface);


	CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->SetRenderTarget(0,pSurface);
	pSurface->Release();

	CSGD_Direct3D::GetInstance()->Clear(255, 255, 255);


	// Renders the background
	for(int layer = 0; layer < this->m_Layers.GetSize(); layer++){
		for(int x = 0; x < GetLayerWidth(); x++){
			for(int y = 0; y < GetLayerHeight(); y++){
				CTile* tile = this->m_Layers[layer].GetValue(x, y);
				if(tile->GetImageID() < 0)
					continue;
				RECT tileRect;
				SetRect(&tileRect, tile->GetImageXPosition()*GetTileWidth(), tile->GetImageYPosition()*GetTileHeight(), 
(tile->GetImageXPosition()*GetTileWidth())+GetTileWidth(), (tile->GetImageYPosition()*GetTileHeight())+GetTileHeight());
				CSGD_TextureManager::GetInstance()->Draw(tile->GetImageID(), (x*GetTileWidth()), (y*GetTileHeight()), 1, 1, &tileRect, 0, 0, 0, -1);
			}
		}
	}
	CSGD_Direct3D::GetInstance()->SpriteEnd();
	CSGD_Direct3D::GetInstance()->DeviceEnd();


	CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->SetRenderTarget(0, m_pBackbuffer);
	m_pBackbuffer->Release();
	return m_pRenderTarget;
}
and here's the code I use to render the texture I created to the screen in the Game's render loop.

code:
CSGD_Direct3D::GetInstance()->Clear(0, 0, 0);
	CSGD_Direct3D::GetInstance()->DeviceBegin();
	CSGD_Direct3D::GetInstance()->SpriteBegin();
		CSGD_Direct3D::GetInstance()->GetSprite()->Draw(m_pLevelTarget, 0, 0, 0, 0xffffffff);
	ObjectManager::GetInstance()->RenderObjects(Cam);

	CSGD_Direct3D::GetInstance()->SpriteEnd();
	CSGD_Direct3D::GetInstance()->DeviceEnd();
if someone can help me figure out whats going On, I'd totally appreciate it.

ZorbaTHut
May 5, 2005

wake me when the world is saved
Can anyone give me a page talking about standard techniques for making platformers? I've had trouble coming up with an elegant way to handle collisions and slopes and the like - I've got a few ideas, but they all seem more complicated than necessary. Can anyone sum up a standard technique in, like, ten lines?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ZorbaTHut posted:

Can anyone give me a page talking about standard techniques for making platformers? I've had trouble coming up with an elegant way to handle collisions and slopes and the like - I've got a few ideas, but they all seem more complicated than necessary. Can anyone sum up a standard technique in, like, ten lines?

No, because the techniques vary incredibly greatly based on the mechanics you want. Find some books on the topics you care about (e.g. Real-Time Collision Detection by Christer Ericson) and get reading. What you're asking right now is equivalent to saying "how do I do math in ten lines or less?"

(Unless what you want is "loop over all pairs of objects and check if they're intersecting", but I'd expect that you know that and are talking more about specific collision algorithms.)

terminatusx
Jan 27, 2009

:megaman:Indie Game Dev and Bringer of the Apocalypse

ZorbaTHut posted:

Can anyone give me a page talking about standard techniques for making platformers? I've had trouble coming up with an elegant way to handle collisions and slopes and the like - I've got a few ideas, but they all seem more complicated than necessary. Can anyone sum up a standard technique in, like, ten lines?

I'd check out the tutorials over at metanet software.

TSDK
Nov 24, 2003

I got a wooden uploading this one

ZorbaTHut posted:

Can anyone give me a page talking about standard techniques for making platformers? I've had trouble coming up with an elegant way to handle collisions and slopes and the like - I've got a few ideas, but they all seem more complicated than necessary. Can anyone sum up a standard technique in, like, ten lines?
Here you go.

newsomnuke
Feb 25, 2007

Zalgorithm time. Given a simple 2d grid map, like any you'd find in a roguelike or whatever, I need to populate it with 'nodes' such that every walkable square is fully visible from at least one node, and every node is fully visible from at least one other node. And obviously, there need to be as few nodes as possible.

I'm only asking here because I'm sure this algorithm exists, but I don't know where to start looking (this is to be used for pathfinding, but it doesn't fall into typical pathfinding algorithms).

tyrelhill
Jul 30, 2006

Darkpenguin posted:

but when I draw the texture to the screen, it gets stretched.

Full Sail student, eh? It's probably cause you're creating non power of two texture.

Adbot
ADBOT LOVES YOU

QuantumPotato
Feb 3, 2005

Fallen Rib

tyrelhill posted:

Full Sail student, eh? It's probably cause you're creating non power of two texture.

Unfortunatly, yes, I am a Full Sail Student. I'm starting to get the feeling that coming to this school may have been a mistake, judging by the reception I'm getting from industry professionals I've met.

as for my question, I did manage to solve it.

code:
HRESULT hr = CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->CreateTexture(a, b, 1, 0,
		D3DFMT_A8R8G8B8,D3DPOOL_MANAGED, &m_pRenderTarget, NULL);
needs to be a render target and use the Default pool. Then it works. Of course, I've had to scrap this set up at this point, but I solved it.
code:
HRESULT hr = CSGD_Direct3D::GetInstance()->GetDirect3DDevice()->CreateTexture(a, b, 1, D3DUSAGE_RENDERTARGET,
		D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT, &m_pRenderTarget, NULL);

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply