Advertisement

A Game Entity Creator Tool

Started by October 10, 2000 04:37 PM
4 comments, last by Opticon 24 years, 3 months ago
In my programming endeavors, about the only useful program I can think to make is a game. However, I am also very interested in Windows programming and have finally come up with something that could be VERY useful... I am thinking of creating a CEntity Class that can be manipulated and saved in a Windows Game tool, then loaded into the game when needed. This way, entire game characters, the bitmaps that make up their animations, any text that goes along with them, even their hit points, and what not can be stored as a single file and then loaded into a game... I''m thinking it could work something like a complicated animated gif, only with bitmaps (and of course, no gif compression). My questions are... Will this work? Will the files be too big? Will my Win32/DirectX game engine load files created in an MFC application? Should I use MFC or Win32 for the tool? I know this has been (somewhat) done before (Starcraft .grp''s)... Is there anything else I should know about?
You certainly can create your own class and stuff and store it''s contents into a file (stats, graphics, etc.). Personally though, it''d be better to save stats and stuff into the game save file (so you can use the character in other games).

Certainly, the sprite format is fine. It''s what I (and I''m sure many others) use.

It''ll certainly work. The files shouldn''t be too big. The statistical information should take no more than 5kB and the sprites for it (unless you implemented fully animated 32-direction walking sprites) would take no more than maybe 25kB if they''re no bigger than 32 by 32.

As for the API, use what you''re more comfortable with. I''d have used MFC. Windows API is just as good. It doesn''t matter at all. Also, of course your engine can load the files. It doesn''t matter what you make the file with as long as you know how to load it (a .BMP or .JPG is the same if you make it with Photoshop, The Gimp or NeoPaint; three programs for different platforms).

-Goku
Advertisement
One thing that you might want to be aware of is that when you multiple entities that are the same (ie. 120 spiders all running around the level), you don''t want to have seperate sprite info for each one. They should all point to the same set of animation frames, thus saving valuable video memory!

Not sure how to implement this in the file saving bit, but when you load them in you could check to see if this specific graphic has been loaded already and if so just assign a pointer to it.

It sounds pretty good though!
This technique could be quite usefule for certain situations that would be difficult to hardwire into the game.

Say for example, you have a 2D Western RPG and you want to create a system that tracks bullet damage on different body parts. If all of your sprites (not the bitmap, but the actual sprite data) are the same size, you could hardwire bounding boxes for each body part with little difficulty. But if you have tall people, short people, long arms, short arms... this gets difficult. So, in your entity editor you could create several characters of varying shapes and sizes, graphically define the target areas (head, torso, arms & legs) and store the bounding box coordinates in the entity file.

One of many possible uses.
That''s good, great feedback! Thanks!
I am sure I can create and implement this, and if someone else wants to steal my idea, go ahead As long as I go through with it and gain the knowledge. The pretty much only thing that''s fuzzy to me is how to do multiple instances of a file... Do I do a pointer to the file? I don''t want there to be 20 "Guards", and they are all doing the exact same thing at the same time... I know that it worked in Starcraft, but I am not sure what exactly I am supposed to point to so I can create many instances of the same entity that act independently. Any ideas?
You don''t need multiple instances of the file. Just load all of the data for an Entity into one Entity object, or perhaps create another class called EntityData and add a pointer to an EntityData object to the Entity class. That way different Entities could easily share the same data.

As far as different AI for each guard, I would suggest that you create a AI class (and perhaps a GuardAI subclass) that contains functions for everything you want the guards to do. Include a pointer in the Entity class. Then you could have your guards select an AI routine at random or according to state changes. That eliminates the sameness.

This topic is closed to new replies.

Advertisement