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
SlightlyMadman
Jan 14, 2005

Ok, so I've been looking back at my old code when I was experimenting with various other libraries besides pygame, and here are the problems:

cocos2d: Project is virtually undocumented and seems to be abandoned.

pygame/rabbyt: Very fast in theory, but animation and changing images within sprites gets tricky. The only real solution ends up being to create a new set of sprites for each frame, to overwrite the last ones, and you lose pretty much all of the performance benefits by doing so.

pyglet/rabbyt: Pyglet has much better sprite support and has animation utilities that make it much better suited than pygame sprites. Unfortunately, there's no way to set the order with which sprites are drawn to the screen, except using ordered groups. In an isometric map, this means you need hundreds of ordered groups to keep things from overlapping, and you again lose pretty much all performance benefits by doing so.

edit: I take back my comments abotu pygame/rabbyt. I've since discovered that you can update a rabbyt sprite's texture on the fly, as well as alter its x and y coordinates arbitrarily, and managed to put together a sample program with animations and map scrolling, that gets almost 100fps.

The trick was to create a "Tile" class that internally holds a rabbyt sprite, which it can keep track of and alter. I then loop through my tiles to get an array of all the sprites that will be on the screen and pass them to rabbyt.render_unsorted (which despite its name actually renders them in the order passed, so overlapping is no problem).

SlightlyMadman fucked around with this message at 23:34 on Jan 5, 2010

Adbot
ADBOT LOVES YOU

Triarii
Jun 14, 2003

I've got a kind of off-topic question. Say I'm programming a game and having a friend do art for me, but then real life intervenes and he's no longer able to finish the game's art. Where can I go to recruit a new artist to do some decent 2D sprite and UI work for me? I'm nursing some hopes of selling the game online for five bucks a pop or something, so I'm willing to pay a little, but I don't have a ton to spend - maybe a couple hundred dollars total. Could I post a thread in Creative Convention or SAMart and expect to get results? Are there other communities that might be more receptive?

wlievens
Nov 26, 2006

Mayakashi posted:

I've got a kind of off-topic question. Say I'm programming a game and having a friend do art for me, but then real life intervenes and he's no longer able to finish the game's art. Where can I go to recruit a new artist to do some decent 2D sprite and UI work for me? I'm nursing some hopes of selling the game online for five bucks a pop or something, so I'm willing to pay a little, but I don't have a ton to spend - maybe a couple hundred dollars total. Could I post a thread in Creative Convention or SAMart and expect to get results? Are there other communities that might be more receptive?

I posted on SA and got one great artist out of it.

SlightlyMadman
Jan 14, 2005

Can anyone tell me what's going on here?


I'm using totally default rabbyt sprites where I just pass the filename in as the texture argument. The tile graphics are pngs with a transparent layer, as I haven't yet figured out how to get rabbyt to recognize a color as transparent:


As you can see, the images should be perfectly sharp and have no pink present, but they're coming out distorted.

GROVER CURES HOUSE
Aug 26, 2007

Go on...

Mayakashi posted:

I've got a kind of off-topic question. Say I'm programming a game and having a friend do art for me, but then real life intervenes and he's no longer able to finish the game's art. Where can I go to recruit a new artist to do some decent 2D sprite and UI work for me? I'm nursing some hopes of selling the game online for five bucks a pop or something, so I'm willing to pay a little, but I don't have a ton to spend - maybe a couple hundred dollars total. Could I post a thread in Creative Convention or SAMart and expect to get results? Are there other communities that might be more receptive?

First, see if the resources you want can be salvaged from creative commons or some other similar source.

Then check http://tigsource.com/

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

SlightlyMadman posted:

Can anyone tell me what's going on here?

I'm using totally default rabbyt sprites where I just pass the filename in as the texture argument. The tile graphics are pngs with a transparent layer, as I haven't yet figured out how to get rabbyt to recognize a color as transparent:

As you can see, the images should be perfectly sharp and have no pink present, but they're coming out distorted.

I don't know anything about rabbyt so this is a total wild guess, but do you have any kind of anti-aliasing going on? If you are using magenta as your transparent color and somehow doing anti-aliasing at the tile level, a bit of the magenta would get mixed into the edge of the sprites and leave a pink outline like what you have.

SlightlyMadman
Jan 14, 2005

Yeah, the crazy thing is, as you can see from the sample I posted, there's no magenta or anything being used. It really does look anti-aliased or poorly resized or something, but I'm not doing any of those things unless rabbyt is doing it without my knowledge.

edit: gently caress it, in less than half the time I was screwing around with tiles in pygame/rabbyt, I've managed to put together the basic foundations of my game using libtcod. Sure, it's ASCII, but I'd rather get the game playable first and deal with the possibility of tiles later anyways.

SlightlyMadman fucked around with this message at 01:30 on Jan 7, 2010

Triarii
Jun 14, 2003

wlievens posted:

I posted on SA and got one great artist out of it.

Was that in SAMart or CC? And how much did you end up paying?

Broken Knees Club posted:

First, see if the resources you want can be salvaged from creative commons or some other similar source.

Then check http://tigsource.com/

I need a bunch of very specific fictional things, unfortunately, so I highly doubt I'll find much of what I need publicly available. I am going the creative commons route for my sound so far, though.

I'll take a look at tigsource. I assume I should be hitting up the collaborations thread, in the Creative forum?

GROVER CURES HOUSE
Aug 26, 2007

Go on...

Mayakashi posted:

I need a bunch of very specific fictional things, unfortunately, so I highly doubt I'll find much of what I need publicly available. I am going the creative commons route for my sound so far, though.

I'll take a look at tigsource. I assume I should be hitting up the collaborations thread, in the Creative forum?

Basically. For optimal results, post a working prototype before asking for help. The fact that you actually put in work to make a mockup will put you above 99% of all other startups.

Triarii
Jun 14, 2003

Broken Knees Club posted:

Basically. For optimal results, post a working prototype before asking for help. The fact that you actually put in work to make a mockup will put you above 99% of all other startups.

I actually have most of a working game. The programming is almost completely done, and I have a fair bit of artwork, but more needs to be made and actually a lot of what I have needs to be replaced because it ended up the wrong size or whatnot.


Click here for the full 966x985 image.

FreakyZoid
Nov 28, 2002

I have just finished the first public version of my first XNA game. It's a score driven puzzle shooter thing.

Gameplay video:
http://www.youtube.com/watch?v=W1rV15h5eeM

Screenshot from a slightly earlier version:


Download link:
http://www.mainlyaboutgames.co.uk/xna/colorzap/colorzap.zip

You'll also need the XNA redistributable, if you don't have XNA installed.

Comments are very welcome. As I said it's my first game, so I wanted to get something playable and of an acceptable level of quality done, and then use what I've learnt in making the next game.

seregrail7
Nov 3, 2006
It's fun, it works and it's easy to understand. My only issue is that the controls are a bit sensitive, it's easy to move 2 spaces when you only want to move one.

Vinlaen
Feb 19, 2008

Does anybody know of a good reference to learn about 2D lighting? (or do any existing engines support 2D tilemaps and built-in lighting with networking capability?)

Jaded Samurai's (work-in-progress) Space Station 13 remake has me inspired to fool around a little bit with creating a remake of my own.

Thanks for any advice!

GROVER CURES HOUSE
Aug 26, 2007

Go on...
XNA has several decent engines available that do both (FlatRedBall, for one).

Vinlaen
Feb 19, 2008

Oh, thanks!

Do you know of any others off the top of your head? (that support 2D and lighting I mean)

ShinAli
May 2, 2003

The Kid better watch his step.
Is there any set of articles that go into the Quake 3 source code in detail? I want to get a good idea of how it renders but I get lost easily in the code.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
I don't know if this is the right place to ask this, but I was wondering how simple it was to have a Direct2D application be on top of a Direct3D, like a game, application. I want to put my window on top of my game so I can get updates from my program while playing.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

ShinAli posted:

Is there any set of articles that go into the Quake 3 source code in detail? I want to get a good idea of how it renders but I get lost easily in the code.

The short version of the renderer is:

- load models and map and materials (called shaders)
- give cgame references to all of those
- cgame positions everything and tells the renderer what's up
- renderer puts triangles or strips/fans or vertex pointers in tess
- the triangles or strips/fans or vertex pointers are blasted to the screen when cgame says it's time

That's a very rough overview. Look into the renderer commands (some of which are named a bit confusingly) and where they're called from for a general view of the flow of each frame. I put together a flowchart once, if I can find it I'll post it.

newsomnuke
Feb 25, 2007

I've finished my scripting language for shmups! :woop: It also doubles as a generic particle system. Here's a brief demo: http://www.youtube.com/watch?v=Y-uw5SfmJ9A

Here's about the simplest thing you can do with it:
code:
emitter Blaster
{
	stage1 = state
	{
		fire bullet(180, 200); // fire a bullet at 180 degrees, speed 200
		wait(0.2); // wait 0.2 seconds before looping back
	}
}
There is a lot more you can do.

If you're making a shmup (or similar) and you're using C++, I recommend it. :cool:

http://code.google.com/p/bulletscript/

gibbed
Apr 10, 2006

ultra-inquisitor posted:

I've finished my scripting language for shmups! :woop: It also doubles as a generic particle system. Here's a brief demo: http://www.youtube.com/watch?v=Y-uw5SfmJ9A

Here's about the simplest thing you can do with it:
code:
emitter Blaster
{
	stage1 = state
	{
		fire bullet(180, 200); // fire a bullet at 180 degrees, speed 200
		wait(0.2); // wait 0.2 seconds before looping back
	}
}
There is a lot more you can do.

If you're making a shmup (or similar) and you're using C++, I recommend it. :cool:

http://code.google.com/p/bulletscript/
How does this compare to BulletML? (if you've used it before)

newsomnuke
Feb 25, 2007

gibbed posted:

How does this compare to BulletML? (if you've used it before)
It has a ton more features, and while I've never actually used BulletML I'm almost certain it's a hell of a lot faster. I wanted to compare the two, but implementing BulletML was too much of a pain.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
So I've done plenty of 2D games and demos in my past, but I want to write a simple 3D rts. (Or at least play around with placing buildings, handling pathing, that sort of thing). Thing is, I've written one too many engine in my day, and I know I get bogged down in working on the engine, and never really finish the gameplay.

Is there a decent 3D engine for XNA? (Preferably something with some GUI elements available). I've done some 3D development with Ogre in the past, and I took my university's awful graphics class that mostly went over how to draw a line in opengl, so I know a little bit about working in this area.

Mr Plow
Dec 31, 2004

I apologize if this questions has been asked too many times, but I've read through large swaths of this thread in the past and I can't remember the answer. What would be the best programming language to learn for a guy with no natural talent at programming, mediocre at best abilities in visual basic, no aspirations to do anything 3D? I've read the little piece in the FAQ was hoping to get more opnions. And please don't say "nothing". :)

Mr Plow fucked around with this message at 03:25 on Jan 23, 2010

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

niteice posted:

The short version of the renderer is:

- load models and map and materials (called shaders)
- give cgame references to all of those
- cgame positions everything and tells the renderer what's up
- renderer puts triangles or strips/fans or vertex pointers in tess
- the triangles or strips/fans or vertex pointers are blasted to the screen when cgame says it's time

That's a very rough overview. Look into the renderer commands (some of which are named a bit confusingly) and where they're called from for a general view of the flow of each frame. I put together a flowchart once, if I can find it I'll post it.
The renderer also attempts to merge layers (i.e. ADD/ADD, MUL/MUL, REPLACE/anything) into single multitexture passes.

cgame could better be called the presentation, since there is actually very little that it independently tracks. The cgame is actually restarted on a video restart and is designed to be reloadable at any time.

I'm pretty sure that Q3 also only uses triangles and DrawElements, never DrawArrays, tristrips, or trifans. Batching is also an important aspect of it, it attempts to group surfaces by shader so it can render multiple surfaces with a single draw call.

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through

Mr Plow posted:

I apologize if this questions has been asked too many times, but I've read through large swaths of this thread in the past and I can't remember the answer. What would be the best programming language to learn for a guy with no natural talent at programming, mediocre at best abilities in visual basic, no aspirations to do anything 3D? I've read the little piece in the FAQ was hoping to get more opnions. And please don't say "nothing". :)

Play around with the XNA starter sets.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Mr Plow posted:

I apologize if this questions has been asked too many times, but I've read through large swaths of this thread in the past and I can't remember the answer. What would be the best programming language to learn for a guy with no natural talent at programming, mediocre at best abilities in visual basic, no aspirations to do anything 3D? I've read the little piece in the FAQ was hoping to get more opnions. And please don't say "nothing". :)

Like the post above suggests, XNA is a good place to start. You can download the programming environment for free and the XNA system takes care of a lot of the annoying bits (loading files, matrix operations, etc) for you.

If you're interested in 2D exclusively, the Reimer tutorial can get you through the basics pretty quick and you can decide from there if you want to stick with it. The tutorials are written in C# but he gives full source code at each step so you can copy/paste and then muddle through the syntax at your own pace.

Mr Plow
Dec 31, 2004

Thanks guys, I'll have a look at XNA and Reimer's tutorials.

Fellatio del Toro
Mar 21, 2009

I've worked quite a bit using XNA but I've grown annoyed by the hassle of distributing XNA games so I've started learning DirectX. I'm still a complete noob to this; I've managed to change the display resolution and swap it back when the program is shutdown normally. The only problem is that when the game crashes or is killed abruptly the resolution doesn't get changed back to the original setting so what I'm wondering is: how would I need to set this up to make sure that the resolution reverts to normal no matter how the program ends?

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

OneEightHundred posted:

The renderer also attempts to merge layers (i.e. ADD/ADD, MUL/MUL, REPLACE/anything) into single multitexture passes.

cgame could better be called the presentation, since there is actually very little that it independently tracks. The cgame is actually restarted on a video restart and is designed to be reloadable at any time.

I'm pretty sure that Q3 also only uses triangles and DrawElements, never DrawArrays, tristrips, or trifans. Batching is also an important aspect of it, it attempts to group surfaces by shader so it can render multiple surfaces with a single draw call.

Clarification: it tries to use arrays but will use fans otherwise (R_DrawElements) or discrete (Multi)TexCoord and Vertex.

There's a lot to improve on in the renderer - ripping out all of that FP code and converting it to GLSL with vertex buffer objects is a good starting point in terms of code condensation.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

niteice posted:

Clarification: it tries to use arrays but will use fans otherwise (R_DrawElements) or discrete (Multi)TexCoord and Vertex.
I guess that's one of those things I didn't notice because DrawElements is supported on basically everything. (HINT: Always use DrawElements or DrawRangeElements)

quote:

There's a lot to improve on in the renderer - ripping out all of that FP code and converting it to GLSL with vertex buffer objects is a good starting point in terms of code condensation.
You will have one hell of a time trying to modernize the Q3 renderer. You could do things like dynamically convert shaders to GLSL, but if you want an actually modern renderer out of it, you need to gut it. The "one texture per pass" approach is totally antiquated, and if you replace that and the tess code with GLSL and overhaul the batching code to work with VBOs properly, you are 90% of the way to a complete renderer rewrite.

I mean it's great if you want to see what a renderer looked like 10 years ago, but it's not exactly prime reference material for today.

OneEightHundred fucked around with this message at 13:46 on Jan 23, 2010

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
So, I'm trying to figure out the best data structures to use to create a tile based 3D terrain a la Evil Genius. (Ie, you can interact with square areas of the game world, place objects in cells, etc.) My thought was to use an NxN array of structs. Each struct would contain information on how to render the cell (are there floors/walls/ceilings in this cell?), walkability (cost of movement through cell, can place objects in this cell), or any other information I might need on a cell by cell basis later (like team ownership, for example.)

From there, I was thinking of maintaining a separate list of entities (dropped objects, critters, etc.) that would be able to navigate the cell grid, while being rendered on a heightmap. Each on would maintain a position in world coordinates, which I suppose could be translated to grid coordinates through scaling. In my original prototype, my entities were children of the cell they were in which made it pretty easy to move them about within a cell (and control where they entered the next cell) it added a lot of overhead of passing entities between cells. Maybe a hybrid solution is best? (Have each cell maintain a list of entities in it, have a separate entity manager maintain a list of all the game's entities for quick iteration.)

I figure I could then construct a scene graph using the terrain as a root node, with the entities more or less being children of that root. Eventually I'd like to have train/tram objects that the entities could ride. It seems like a very broad scene graph when I visualize it mentally (with almost everything a child of the root).

I've done very little 3D development before, although I've done plenty of 2D development, so I'm looking for input on what you've done that works, avenues to research (just learned how to properly use MVP matrices), or any resources that might help me approach the design for a 3D tiled environment.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Pfhreak posted:

From there, I was thinking of maintaining a separate list of entities (dropped objects, critters, etc.) that would be able to navigate the cell grid, while being rendered on a heightmap. Each on would maintain a position in world coordinates, which I suppose could be translated to grid coordinates through scaling. In my original prototype, my entities were children of the cell they were in which made it pretty easy to move them about within a cell (and control where they entered the next cell) it added a lot of overhead of passing entities between cells. Maybe a hybrid solution is best? (Have each cell maintain a list of entities in it, have a separate entity manager maintain a list of all the game's entities for quick iteration.)

If the cells maintain a list of what entities are inside them and the entities are able to figure out which cell they are standing on based on their position, couldn't the entities also be set up to detect when they change cells and update the cell lists?

Something like this, assuming myCell, oldCellX and oldCellY are part of the entity object and the GetCell*FromPosition functions map the floating position onto whatever cell the entity is standing on.
code:
UpdateEntityPosition(float newX, float newY)
{
   int newCellX = GetCellXFromPosition(newX)
   int newCellY = GetCellYFromPosition(newY)

  // check to see if the entity changed cells
  if (newCellX!=oldCellX or newCellY!=oldCellY) then
  {
    // cell has changed, update current cell and cell lists
    myCell=cell(cellX, cellY)
    cell(oldCellX, oldCellY).EntityList.Remove(thisEntity)
    cell(cellX, cellY).EntityList.Add(thisEntity)
  }

  oldCellX=newCellX
  oldCellY=newCellY
}
Each entity can move around freely and it knows what cell it's so it can get info from calling things like myCell.height(). When you go to draw the scene you can still scan through all the cells back-to-front and draw whatever entities exist in each cell.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
Yeah, that's certainly a lot less coupled than having the cells try and maintain what is in them. Thanks for giving me an extra set of eyes on the problem.

Contero
Mar 28, 2004

OneEightHundred posted:

I mean it's great if you want to see what a renderer looked like 10 years ago, but it's not exactly prime reference material for today.

What would be a good reference for modern rendering code?

newsomnuke
Feb 25, 2007

OGRE?

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
How do you guys (and gals) manage entities in the game world? Do you just keep them all in the scene graph itself? It seems like keeping game logic out of the scene graph is a cleaner design, but then entities need to maintain a reference to one (or more) objects in the scene graph and update those references frame to frame.

Are there accepted design patterns for entity management and inter-entity communication?

Hubis
May 18, 2003

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

Pfhreak posted:

How do you guys (and gals) manage entities in the game world? Do you just keep them all in the scene graph itself? It seems like keeping game logic out of the scene graph is a cleaner design, but then entities need to maintain a reference to one (or more) objects in the scene graph and update those references frame to frame.

Are there accepted design patterns for entity management and inter-entity communication?

I use the "Forest of Trees" approach.

I usually keep entities separate from the scene graph (in a spatial data structure if necessary) since they're usually totally independent from one another. Each entity keeps a set of "instance-specific" state (position/orientation transforms, maybe effects states) and pointers to "shared" data (textures and a vertex buffer containing for rendering the entity, or maybe a self-contained scene graph if the model is sophisticated). For rendering, I march through the list of entities in an "accumulate" pass and build a flat list of render tasks (shaders+state+buffers) out of this data. Then I feed this list to the actual renderer, that takes care of... rendering.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
So each, say velociraptor, would maintain it's own position, velocity, etc. They would also share a reference to a single velociraptor model. When it's time to render, each individual critter sets the appropriate transforms for the single model and submits it to be rendered.

When you are working with your entities, particularly message passing, do you have a manager class orchestrating the whole venture?

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Contero posted:

What would be a good reference for modern rendering code?
It's hard to even give one because things are in flux at the moment. Things aren't really as consistent as they were when everyone was trying to copy Quake 3 or Doom 3. Now, there are several approaches and which one is the best depends entirely on what you're making, mainly because there are several completely incompatible ways to deal with lighting, especially lighting over large areas.

Adbot
ADBOT LOVES YOU

heeen
May 14, 2005

CAT NEVER STOPS
Scene graphs - just say no

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