RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next 
View previous topic - View next topic  
Author Message
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Tue Feb 17, 2009 1:06 am    Post subject: [quote]

Captain Vimes wrote:
Okay, so, I got Code::Blocks. I'm going to try it out now, but first...

I still don't see why this would make the error "class Hammer has no member named 'Update'" appear. I mean, the Update() function was still there. It just called two other functions instead of doing it all in there. Or am I missing something really obvious?


I did not find anything wrong in the code, so it leads me to believe it was some stupid thing that was up with your project files.
I have no idea without having the actual files themselves. Posting the code on the forum failed btw...it messed up quite a bit, so I used the original hammer engine code that I did for you and then made the working zombiehorde project that I posted.

Quote:

I'm not really sure what the difference between all the different types is. I think I know what a tile engine is (like Pokemon, right?) and I can guess what a big-bitmap is (just one giant bitmap that you render piece by piece), but I'm not sure what a sparse-space is.
But unless the sparse-space is something really, really cool, I think I'm looking for a big-bitmap engine here.


Okay here is a crash course.

Tile engines are whats behind nearly every 2D RPG and of course many other game genres as well ..and even some 3D tile engines exist, but that is besides the point.

Big-bitmap is where you load in large pre-rendered scenes into a BIG bitmap and then you blit a portion of that scene depending on your player's view. You might have a full-screen view that shows all the scene, or you might have a small view that shows a small section of the scene.

what I meant by Sparse Space is like games like where you can fly around in space, in any direction, and there is nearly nothing but blackness around your player; the only indication of movement being a sparse starfield and possibly enemies moving around you.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Tue Feb 17, 2009 1:18 am    Post subject: [quote]

Okay, then... Looks like big-bitmap is what I'm looking for. I'll Google for some tutorials, but if you could post any that you know are good then that would be greatly appreciated.

EDIT: Oh, and I tried Code::Blocks, but it isn't linking properly for some reason. This thing has to be finished soon, so I think I'll stick with Dev-C++ for now.
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Tue Feb 17, 2009 2:06 am    Post subject: [quote]

I don't know of any tutorials off the top of my head.

If you are more specific about what you are wanting to implement,
Like, find a game that is similar to what you are trying to do, and post a link to it, then I can help you out with the implementation.

Yeah, don't switch to Code::Blocks mid-project like I did (I was able to do so because my BUILD process never changed. I do not build with Code::Blocks. I use SConS. I'm only using Code::Blocks for an editor/project manager.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Tue Feb 17, 2009 10:16 pm    Post subject: [quote]

Sparse space style engines generally store the coordinates of objects, since the entire map is generally filled with empty space (or a default tile such as grass or water).

Think of outer space with only a few stars or planets. There is no reason to store data for all of empty tiles, you only need data to display the stars or planets. The rest of the screen does not need to be rendered.

Another example would be an ocean map where there are only a few small islands or other geographic features on an entire map. The rest of the screen can be filled with a water tile.
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Wed Feb 18, 2009 6:36 pm    Post subject: [quote]

That sounds about right. I'm just going to have a bunch of randomly-placed buildings and everything else is going to be grass. Which would you guys recommend - big-bitmap or sparse?
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
Rainer Deyke
Demon Hunter


Joined: 05 Jun 2002
Posts: 672

PostPosted: Wed Feb 18, 2009 8:36 pm    Post subject: [quote]

There are all kinds of difficulties with sparse space engines. For example:
  • You can't have, for example, several different grass tiles for variety.
  • If your maps are big, you need some sort of spatial partitioning so you don't have to iterate through all off-screen elements every time you redraw the screen.
  • Collision detection is slower than a simple tile map, and much slower without spatial partitioning.


Overall, sparse space engines have their uses, but they are harder to work with and you need to be aware of their limitations. Avoid them unless you have a really good reason to use them, and sufficient experience to use them correctly.
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Wed Feb 18, 2009 9:49 pm    Post subject: [quote]

Captain Vimes wrote:
That sounds about right. I'm just going to have a bunch of randomly-placed buildings and everything else is going to be grass. Which would you guys recommend - big-bitmap or sparse?


Tile engine for the grass (really easy) and the buildings would be placed just like one would place an NPC.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Thu Feb 19, 2009 9:25 am    Post subject: [quote]

I've been mixing tiled maps for grounds and decorations layer, and using a sparse space approach for players, NPCs and monsters. Works well enough for me.
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Thu Feb 19, 2009 2:36 pm    Post subject: [quote]

Hajo wrote:
I've been mixing tiled maps for grounds and decorations layer, and using a sparse space approach for players, NPCs and monsters. Works well enough for me.


Thats exactly what I was talking about.
And, that is how my system works for my entry in the 48h jam.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Thu Feb 19, 2009 3:28 pm    Post subject: [quote]

Rainer Deyke wrote:
There are all kinds of difficulties with sparse space engines. For example:
  • You can't have, for example, several different grass tiles for variety.



You can, if you have a function like f(x,y) that calculates a 'random' number of each tile coordinate, which then is scaled to the range of your grass tiles. Perlin noise, or another kind of seeded RNG can do the trick here.

Edit:

Such functions tend to be a bit slow though, or not very random. So this adds some overhead to the display routine, but adds a bit variation to the grounds.

A very coarse solution is something like f(x,y) = (y*11 + x*19) mod 7

You may need to fiddle with the factors to avoid obvious patterns. Make sure to use prime numbers.
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Thu Feb 19, 2009 6:16 pm    Post subject: [quote]

Okay, then. Big-bitmap it is. Any tutorials that stand out in your memory?
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Fri Feb 27, 2009 9:53 pm    Post subject: [quote]

HELP!

I've been sick since Saturday and haven't been able to string two thoughts together without wandering off on a tangent. I woke up this morning and realized that this game was due for the contest TOMORROW! I'm making progress fast but I have no idea how to fix this problem and it's stopped me cold!
I know exactly what the problem is - I'm deleting a zombie from the sprite list when it gets shot. Unfortunately, this means that the next call to the Update() and/or Draw() functions accesses a NULL pointer and crashes the program. How do I fill in the gap in the vector?
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
Rainer Deyke
Demon Hunter


Joined: 05 Jun 2002
Posts: 672

PostPosted: Fri Feb 27, 2009 10:06 pm    Post subject: [quote]

To remove an element from a std::vector, use the 'erase' member function.
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Fri Feb 27, 2009 10:29 pm    Post subject: [quote]

*gives Rainer a cookie*

Thankyouthankyouthankyou

I haven't used vectors before, so I have no idea how they work. Thanks a lot! :D
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
Captain Vimes
Grumble Teddy


Joined: 12 May 2006
Posts: 225
Location: The City Streets

PostPosted: Fri Feb 27, 2009 10:35 pm    Post subject: [quote]

Okay, tried that, not working, here's the code:

Code:
void SpriteManager::Delete(unsigned int index)
{
    std::vector<Sprite>::iterator iter;
   
    for(int i = 0; i < index; i++);
        iter++;
   
    spriteList_.erase(iter);
}


Anyone? Please!
_________________
"Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
Back to top  
Post new topic Reply to topic Page 7 of 8 All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum