Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MarcusLM

Handling RPG Item Pictures - ideas please.

This topic is 6826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!