Skip to main content
gamedev.net
🔒 Locked

Editors,MFC and Scripts...

Started by SteveB 10 replies 700+ views
Original Post
SteveB
SteveB
Hello, Iv'e been looking into creating a simple editor,trying to find & research info from the net,about different ways i could start to build one.The only good article i could find close to an editor (was here at gamedev.net)using MFC. I know that creating an editor is a complex subject,so i don't expect to find a 'How To build a level-editor' tutorial,but i'm still unsure about how i could a lot of things,that my editor might need to do. Right now i know the (basics)of Win32,(for creating games)and know little about MFC.Iv'e thought about stopping what i'm doing now,to learn MFC in more depth,for the editor GUI,and making my game into 1(or several).dll's,that can be used with the GUI.(The functions inside the .dll's,for example:the code for loading an .xfile in my engine,could be used for the functionality of loading an .xfile in the editor). I could create the GUI(Menus,buttons etc etc)with MFC,which might load the engine.dll(s) when the editor starts. The GUI,might call functions from inside the .dll's,like for the view(s)loading an object,or deleting an object and so on. One thing that confuses me,is how the data that would be created from within the editor,could be saved out,and ran when you would run your engine .exe.For example,if my game used scripts,would it be possible for the GUI to load a script, (or run the engine .dll,using a script) which would be the view(s),you would get in the editor,and be able to make changes to the script,getting a preview of what you are editing(WYSIWUG)?and then save that script,from within the editor. For example,You might load a script into the editor,which might call the various functions from your .dll(s)(and give you a preview of the game running that script).In this imaginary script,there is an object placed at 0.0.0 coords,you then made a change to this script (from within the editor)to: 20,20,20 coords,you would then see the object move to those coords instantly,in the view of the editor(modifies the script,and save the changes). whereas normally,without an editor,you would make changes to the script,save it,and run your game .exe to see the changes. am i on the right track here for creating this kind of editor,or way off? Thanks. Steve. [edited by - SteveB on February 21, 2003 2:02:33 PM]
Muzlack
Muzlack
I was thinking about the same thing a while back... But I cam to this conclusion: I''m going to write my own GUI. This will make things a lot simpler if you''re going to have any kind of GUI in the game as well. I will make Buttons, Listboxes, Comboboxes, Filelists (at least that''s what I''ll call em), FolderLists, Windows, Labels, and Textboxes. This way, you''ll learn a LOT more, you''ll have something VERY reusable, and a nice interface that you like.

As far as saving your file, I am going to try this with my next game. I will be using a big image pool, so all the images used in the game (aside from backgrounds) are lumped together. I''ll make one big file that will have all the pixel data, and information for all the sprites in a Sprites.dat file.
Then I''d have the rest of the data in Game.dat. That''s what I think I''m going to do. This will leave a very simple, 3 file system (exe, 2 data files)
--Muzlack
SteveB
SteveB
Thanks for replying Muzlack,i think for now i''ll plod on with what iv''e been doing,and hopefully the course on creating an editor at Game-Institute will be available soon.
Steve.
Basiror
Basiror
well guys the art of programming is to code things the way that you can use your code again

2. steve you have never programmed an editor but start with a rather complex concept
from my experience i know that this kind of project planing leads to failures


id suggest you take this mfc tut on creating 3d tools

do it without having a look at the source code contributed
once you got that
set up your grids and add the necessary features to the grid like zoom,snap to grid and so on

you ll see that this isn t difficult to code but damn difficult to figure out so that it works

and when you use MFC you have the document view architecture
which simply mean that an MFC-SDI application has one document
which acts as a container for all your data which you are loading/saving

and there s already a built in support for the documents

you should be busy with these few things for 1 or 2 weeks

then comes the primitiv creation which will take another few weeks
you have 3 options:
1. create vertices->connect them to polygons
2. create brushes like quake engine editors do
3. create polygons which contain their own vertices

3ds max uses the 1. method


then think about the file format design and possible plugin support
http://www.8ung.at/basiror/theironcross.html
Basiror
Basiror
from what i have heard .NET is very slow in 3d applications

and a decent editor needs to have a good performance
http://www.8ung.at/basiror/theironcross.html
SteveB
SteveB
Hi Basiror,
Yes,its a complex idea to start with,but there''s no point in kidding myself it will be easy-I know the basics of what my editor will need to do(which is quite complex).
I know what you mean though(getting ahead of myself)its just the way iv''e always done things,like learning to program-I didn''t start with something easy like visual basic,just jumeped straight into c/c++,i like challenges! Lol
Seriously,you both seem to know what your talking about here,
i don''t suppose i could convince you basidor(or anyone else)
to extend that article on creating tools with MFC could i?
or even better,do your own NEW article on this kind of thing?
I think a lot of people here would be glad of it.
Thanks.
Steve.
p.s
i did manage to find a code example(an article) last night,that uses a D3D view with MFC.(haven''t read it yet though).
Thanks again.
Basiror
Basiror
you don t want to know how often i have redone the primitive creation in my editor now


this article is fine but it has a few bugs which were a pain in the ass to fix

i am planing to write a series of articles about MFC once i got most of my editor done

and i need to fresh up my HTML :D


right now my editor works like 3dsmax

you create objects and these objects contain a linked list of polygons

when i render i set up a list of the polygons which are in my few frustrum for the 3d few to reduce the number of polys to test for selection


http://www.8ung.at/basiror/theironcross.html
Antony52
Antony52
I would be more than grateful if you could answer me these question.
I am learning C# and .NET to build an editor like you guys.However I would like to know whether I should learn an API in the way also.Is it necessary?
Any good books for wannabe game tools programmers?
SteveB
SteveB
Hi Anthony,
Iv'e searched and searched...yes and searched,for a decent book
to get me started with doing my tools.....no luck so far.

It seems to be one area that is lacking(in the books dept)
Ahem..ANDRE,we need a good book on creating our tools(think about how many will buy it!LOl)-:

if anyone wants to be a smartArse>and say 'well here is one..'
Go for it!
because i found hardly anything on getting started with this subject.
Steve.



[edited by - SteveB on February 23, 2003 11:24:01 PM]
SteveB
SteveB
Hello Basiror,
i look forward to your articles,as i'm sure others will too):
Steve.

[edited by - SteveB on February 23, 2003 11:22:21 PM]
Basiror
Basiror
these articles can take some time

i suggest you get programming windows with MFC Second edition from jeff prosise

pretty good book

you shouldn t read it but use it as a reference to look up how to do certain things


first i d do the joe houston tutorial on this page and play around with adding controls

controls are usually linked as class members to access their data

DDX_Control(......)
connects them to the member variables in your DoDataExchange function

http://www.8ung.at/basiror/theironcross.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.