Archived

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

Files and games

This topic is 5333 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

Ok, I need to design a file system for my game. I want to support mods very easily, maybe even have a "Mod tool" or whatever...so i don''t want to have to recompile every time i have to change something. This is what i''m thinking right now: Game.dat -- Describes the main features of the game, such as the main character, number of levels, splash screen, etc. Level1.dat -- Describes the level. May be multiple levels. Extension.dll -- Describes functions that can be carried out druing init, run, and shutdown phases of the game. The calling of these functions will be hard-coded into the game, but this DLL is the implementation of those functions. Character.dat -- Describes one game character. there will be several of these. Any suggestions? also, what should i do about sounds? thanks!

Share this post


Link to post
Share on other sites
For those things, you may either choose to copy or create a scripting language of your own. Your program could check for whatever files and interpret the lines to generate whatever was made. Your scripting language could be like HTML or BASIC, or whatever. Just like your character data, you read in values to change whatever attributes you want. Hmm... has idea, opengl emulator that generates shapes based on keywords you put in.

Share this post


Link to post
Share on other sites
Hehe, finally a game maker starting with the right approach: "Build managers for everything"... Or at least close enough.

MattS423, I invite you to think of your intention as a few separate things:
1-Create a File system to deal with files yourself, be them media, script, DATA or other files. You'll benefit to learn the Windows (you code in windows, I assume?) APIs related to virtual file mapping: Those read the file in memory and return you some simple pointers. And they're much faster than fread-style functions.
Those APIs are: CreateFile - GetFileSize - CreateFileMapping - MapViewOfFile
(You can have a look at this post: http://www.gamedev.net/community/forums/topic.asp?topic_id=155010 it's about a generic file system)

2-Now the script engine, you want to build a flexible game? Not recompile all the time? I invite you to have a look in the articles section on 'how to build a script engine in C++'. It's all there.

3-Make sure you know how to make a mod-friendly architecture. It is a separate problem from 'having a file system' and saving on compile times'

Don't mix your three problems together, eh? Divide and conquer, and godspeed with your idea.

=^.^= Leaders and teachers should remember: It is best to offer others what they Need , not what they Want .

[edited by - Spacecat on May 6, 2003 1:57:37 PM]

Share this post


Link to post
Share on other sites