Jump to content


2D - First Game


4 replies to this topic

#1 Jack9

    Member

  • Members
  • PipPip
  • 37 posts

Posted 03 March 2006 - 06:29 PM

There appear to be many approaches to sprite rendering. From algorithms for buffer control to widget libraries, I'm looking for advice. I consider myself a half-decent programmer, with near-0 graphics experience. I've done business logic my whole life. I would like to know what libraries would be suitable for creating a GTA2-like environment. Let's imagine a mass-hysteria simulator using a GTA2 engine.

Basically I figure I want to create a top-down environment with 5 layers -

Very large ground/background sprite -
ground textures
Collision 1 [Alpha] -
certain areas block movement, like buildings, chasms, etc.
Pathing 1 [Alpha] -
pathing routes for normal NPC travel
Active 1 [Alpha] -
avatar, environment entities (like non-mobile cars)
doorways (script triggers), trees (blitting)
Display Layer -
Infopanels

I'm not interested in the game GTA nor in cars driving around, but the NPCs are important. If some of the active layer are colliding (Avatars), I'm not sure how you are supposed to design that efficiently. Lots of persistent figures planned to be on and off the camera view.

I was looking at Grim2D but couldnt get the tutorial apps to compile. I have nothing against any specific library. I just want something that will work and render as fast as possible, hopefully provide some collision detection, and uses whatever technologies are available. Minimum spec of my Radeon x800.

#2 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 893 posts

Posted 04 March 2006 - 01:40 AM

What kind of numbers are we talking about? 10k people running around? Could be tricky to simulate, but sprite rendering should be a nobrainer. If you plan to do this in hardware, you can use more sprites, and you get scaling and rotation for free. But it makes pixel-based collission detection a bit tricky.

I found SDL to be pretty neat for 2D. The C-based interface is a bit... Not very OO. But it works just fine.

Something like this (city environment?) should probably be tile-based. That way you won't need so much memory. A single sprite for the background sounds a bit wasteful.

#3 Jack9

    Member

  • Members
  • PipPip
  • 37 posts

Posted 04 March 2006 - 03:05 AM

NPC count under 2500. I dont think it's sane to do collision testing NPC versus NPC offscreen.

Massive bg tile is how GTA does it. I just dont see the advantage of cutting it up the Background when it's always static. The other layers will definitely be tiled.

#4 ray648

    Member

  • Members
  • PipPip
  • 42 posts

Posted 04 March 2006 - 08:33 AM

With no collision detection for offscreen npcs, dont forget to consider what happens when the player moves resulting in two npc who were previously offscreen and colliding coming into view.

Ive used sdl a little in the past and agree its not bad. Most of the graphics work I do is in C# so i mostly use managed direct x.

You may want to state the target platform and development language, as can have an effect on which options are available to you.

#5 Jack9

    Member

  • Members
  • PipPip
  • 37 posts

Posted 04 March 2006 - 07:06 PM

Offscreen stay overlapped until they reach a non-collided state at which time collision testing starts. This means they can contiue walking through each other continuously in some situations...not a big deal if there's already that much NPC traffic or they just happen to be walking side by side. Many older platform games use this method.

My platform is PC with a Radeon x800. I havent decided on a development language. I am considering Python and C++. Since most drawing ... well most libraries in general are in C++. I'm language agnostic, but there's no replacement for having numerous tools available to solve numerous problems.

Edit: pygame will be my graphics engine. if it fails to perform, I will reevaluate other alternatives





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users