Advertisement

Handling RPG Item Pictures - ideas please.

Started by March 08, 2000 10:31 AM
3 comments, last by MarcusLM 24 years, 9 months ago
I am working on a small 2D tile-based RPG game and I am trying to figure out how to handle storage retrieval of the images that represent items. If I have say 100 items in a game then should I store all the pics in one image file? That seems like a lot to keep in a DX surface in memory when I may only be using 1% of them in a given area/dungeon. I thought about pulling these pics in by area/dungeon when I load the area/dungeon data. But then I thought about the character''s inventory and that he/she may be carying around items that they picked up several areas/dungeons ago so those pictures are needed for the inventory screen. Another thing too is that I would sometimes be using the same pics for different items. Anyone out there have any good ideas/suggestions/methods they are willing to share?? Thanks. Marcus
You could try loading the ones for that particular dungeon then loading the ones in the player''s inventory on a need-to-see basis (i.e. if it isn''t there, don''t load it)

--------------------


You are not a real programmer until you end all your sentences with semicolons;
www.trak.to/rdp

Yanroy@usa.com

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

Advertisement
With todays cards and AGP, I don''t think you have to worry too much about a 100 bitmaps in memory at once representing your items. What you have to worry about is when this number begins to climb. If loading of your zones is slow then place all objects in memory at one time when the game boots. If you zone loading time is fast then implement a more intelligent object bitmap loading scheme as described above. You could even extend this to recognize if a bitmap is already in memory when loading a zone.(ie the players inventory is most likely still there) Good luck.

I would think that this decision is dependant upon your zone loading times. Everyone hates and cringes at the LOADING PLEASE WAIT.... messages in EverQuest. Baulders Gate does a better job with loading times than EQ but even it has some slow loading zones.


Kressilac

ps the problem gets more complax when you deal with networked games because now you have to make sure that each player has a copy of each object in the zone they are in loaded on the graphics card.
Derek Licciardi (Kressilac)Elysian Productions Inc.
To the question about haw to use the same pic for various things, i´m thinking about create some buffers and store the same pic there... Then just call the buffer you want with the same pic inside!!! I hope i could help you...

bye!!!
To code is to make things come to life ;)
You might be able to load each image onto a separate surface as you require it; if you used a linked list for the items and their respective images, then once you have your linked list working, it should manage itself. When a new item is created, all the image pointers (surfaces) in memory should be checked to see if its image is already there, and if not, create a surface for it. It doesn''t take long to load a few small images every now and again. Just throw them out when you load the next level. If you give the item''s class a reference to its surface, through either a pointer or an index in the list, there shouldn''t be a problem... anyone who knows more about this, please reply, because I''m not completely sure if this will work. But I''d give it a go

-----------

C++ is the language of the not-so-ancients.
Learn to speak it well.

BeamMeUp
-----------C++ is the language of the not-so-ancients.Learn to speak it well.BeamMeUp

This topic is closed to new replies.

Advertisement