How do you make a World Editor?

Blitz3D Forums/Blitz3D Programming/How do you make a World Editor?

Der Vampyr Engel(Posted 2003) [#1]
Yes I would like to know how to actually make a world editor as suppose to just buying one, I would also like to know how you transfer code to each individual charactor or A.I NPC, how would I get the brains to work with them exavtly,
I ham sur there as people out there would could help in?please reply and if all you have are negative commenns,plae stay of ot this thread


jhocking(Posted 2003) [#2]
It depends what you want your editor to do. A placement editor (ie. you can't create or edit meshes but you can load and place existing meshes) is easy enough. Anything beyond that, if you are asking this you don't have enough knowledge yet (sorry.)

To create a placement editor you only need a few basic functions. One to load levels (most likely using a custom file format; read up on the file commands in the command reference,) one to save levels, one to load objects, one to move objects, one to delete objects, and that's about it. You just load objects, use CameraPick to select them with the mouse, move them around, and then save their filenames and coordinates to a file. In your game you load the objects based on the level file, placing them at the saved coordinates.

For your editor's GUI (eg. buttons to load and save) you should get one of the free GUI libraries floating around. I recommend BBGui but a lot of people like Xlnt GUI.


Bot Builder(Posted 2003) [#3]
Yeah. placement editor is what I'm wotking on. It's pretty basic, as it just loads or creates primitives that are positioned/rotated/scaled/alphaed/textured. I'm also going to have two file formats. *.cscen and *.scen. The *.cscen will be the compiled scenario file, containing the raw PRSAT data, while the *.scen file will contain the individual steps to create the data. I have one command so far that would show it's data in the *.scen file and not the *.cscen file. It's a command that aligns an object to the level. this just changes it's position.

anyway, enough about my editer. as far as Npcs go, what kind of AI npcs are you doing? enemies? townspeople? allies? In the case of enimies, a lot of times it is safe to create some basic enemy behavior functions that make dicisions upon the enemies AI settings, the enemies enviornment, and the enemies status.

For instance, somthing in the files says that the enemy patrols several specific points. The player is not detected in the local enviornment, and enemy didn't see the player recently. The function would then lookup the enemies movement speed and turning speed, and begin patroling. then, lets say the player came around the corner in front of the enemy. The function would look up the enemies reaction time, and switch mode from patroling to engaging player once the reaction time was up. the enemy might then have an accuracy setting that represents how accuratly it shoots.

townspeople might have a file with dialog, answers to questions, as well as commands to modify the players status, for instance taking away 5 gold and giving an item.

I don't know much about programming allies, but I figure that it is a more sophesticated version of an enemy. Perhaps a mix of townsperson and enemy AI with the ability to take commands.

other than that, good luck.


Stickman(Posted 2003) [#4]
Creating your own editor may it be a placment editor or a full blown modeling one won,t hurt you a bit,if anything,will help you out a lot.

I am basickly 95 % done my stickman editor ( world modeler ) and after going throught all the steps and headaches ( and lots of them to ) Today I have a much better understanding of how 3D and programing works.

This knowledge isn't fully needed to create a game in Blitz,but it sure dose help a heck of a lot.

As for A.I I have yet to step into this part of my game yet but my plan of attact is somthing like this.......

To create seprite functions for each and every AI action(ex. chase after,Runfrom,Climb,Patroll,etc. )
then Create AI Types that will Include a combination of one or all AI actions.

This method as far as I see would yeild most flexible as for I could add Create new AI actions and AI Types that could fit into different game situations.
Its just an Idea ... Yet to be tested.


Doggie(Posted 2003) [#5]
I have to add my agreement here. Coding "HomeSpun" helped me understand a lot of things about Blitz. The good thing is you can start real basic and then add everything you think of as you go. I'm still working on it here and there. Problem is the things I want to add now will take more time,thought and energy than I have to devote to it. Ah well...someday I'll get back to it. The cool thing with HomeSpun is not only can you save the worlds but the editor outputs complete game code in first and third person mode.

You can download a copy at the Blitz Showcase and the "loader" code for the levels will reveal how to code the "save" functions if you can look at them and then reverse the process. It's easy.

Doggie


Der Vampyr Engel(Posted 2003) [#6]
Right I want my code or "brain" to be assigned to the charector so it works you see, say I have an Aircraft Brian I can then sepatrate it from the player brain so that I can allow the player to go in and out of the Aeroplane (or Airplane if your an American)so then I can have the player control and fly the airplane and get out of it while thje plane either just stands there not used or if an A.I NPC get's into it the A.I pilot can control the plane.

It will be for my R.T.S. which get's it's influnce from Battlezone R.T.S. series . I don't which to code it althoghter as it will make it very difficult, rather if I can code a Player or player object, an A.I. N.P.C., and a vehicle that can be used by both then I can put in things like hovercraft tanks, hover tanks, wheeled tanks , tracked tanks, hover bikes, airplanes, space planes, massive starships, compound heilcopters, E.T.C. all that the pplayer or A.I N.P.C's can eject in or out of and also get in or out of.


What I want my world or placement editor to do is to be capable of exporting code to each entity separately without me having to put include world instructions in the brain or is that not possible?

Also I want my editor to be capable of being able to sustain whole cyber planets, Earth sized and larger.

I will investigate this Homespun and see if that can do the job for me as well I hope it helps me to eventually learn how to code my own world editor as well.


Gabriel(Posted 2003) [#7]
You're making life far more difficult than it should be by sticking to the 3dRad "brain" way of thinking. By trying to create a level editor that does all the code for you, you'll drive yourself nuts. Create a level editor that has object properties and possibly some scripting and accept that you are actually going to have to write code for each game, and you'll find life much, much easier.


Ricky Smith(Posted 2003) [#8]
OK first of all you need to rethink the concept of "Brains" with Blitz3d- this is a programming philosophy used by 3d RAD and to some extent Gamestudio aka A6.
In very simplistic terms these products assign a collection of functions and properties to an entity that then acted like its "brain" or AI and would interact with the 3d world accordingly and independantly of the rest of the main code.
Blitz3d is not object orientated and therefore you cannot assign sections of code to an individual entity and then forget about it.
However you can write your "Brain" for each entity as a collection of functions that can be called by your main program to achieve the same results.
A World Builder or placement program could export the level with properties for the entities including a "Class" property which could be the type of vehicle etc.
I don't think that anyone could give you the exact AI code as it would be quite lengthy and would depend on many other factors.
What would be a good start would be to create a Vehicle Type structure with fields for Class, Control_Type,Maximum Velocity, Minimum Velocity, Acceleration etc, etc and then when you update each vehilcle you use the values from its type structure to animate it. If the Control_Type were "human" for example then you would overide the computer control with the Player controls but using the limits held in the type structure for that vehicle.

I know this is very vague and is probably not what you are looking for but its a start.

P.S. I remember in a previous post a while back I said I would show you a demo of some combat code and jumping into and ejecting from craft. Well I must confess that I never got round to posting it - first because I'm a lazy git and second cos I had nowhere to post it.
I have somewhere now so I'll try and post it soon (Joystick control works a treat as well ) - I cannot release the source as yet at least until it is finished but I could explain the techniques used which are pretty basic.
Cheers
:)

Edit :(Sorry for the repetition about brains - didn't see the previous post)


Ricky Smith(Posted 2003) [#9]
EDIT: removed "random" giant screenshots of demo !


Doggie(Posted 2003) [#10]
Well, keep in mind that Homespun will just let you create and save your level. You can add any amount of 3d objects up to I think 500 and add primitives(cubes, cones spheres etc) but there is no "brain" function. I'm currently working on adding MD2 placement and movement functions with basic ai but just haven't had time to get it done.


jhocking(Posted 2003) [#11]
Geez Smiff, what's with the random giant screenshots? Even if they were on topic I'd be annoyed because they take up so much space and take forever to download; here they're not even on topic.


Ricky Smith(Posted 2003) [#12]
Joe, - maybe got a bit carried away there - now removed !
The 3 jpegs were only 70k each that's hardly giant !!
Whether they were off topic is debatable - they were shots of a demo that does exactly what the original poster was trying to achieve !
Maybe you should try some Anger Management program ?
It seems you get annoyed very easily ! :P


Der Vampyr Engel(Posted 2003) [#13]
I get you Smiff ,kind of similar to the Battlezone engine itself although that really also does a type of brain concept and things like parent/child merging with the child controlling the parent or in more simple terms in and out of vehicles with the pilot/driver controlling the vehicle abd is able to get in and out of them is hard coded into the engine and you have to put say for exapmle "iv" or"fv" to allow the player and A.I pilots to get in and out of the vehicle.
I think that the main program idea of brains would be it where all the R.T.S. , player and A.I pilot funtions would be written in it and the vehicle class structures would be separate, with the joystick and mouse functions separate as well

They are broken down into classes hovercraft class, pilot class, tracked vehicle class, animal class, e.t.c. and you can get in and ut of any vehicle as long as it has "iv" or "fv" in it's ODF. if it doesn't then you can, all I want it to be able for the player to be able to get in and out of a vechile, to have a properly controlled plane or spaceship so that the player can eject using ejection pods which will have full steeridge but minimal defensive weapons so that the player or a.i could go back to say a starship base , that would be for the space and arial vehicles, the ground vehicle ejection would be just the player being ejected out of the vehicle. I look forward to seeing this demo and code and I now have an old Saitek X36T & X35f H.O.T.A.S Joystick and throttle system with rudders and a new Thrustmaster Afterburnber USB Forcefeedback H.O.T.A.S system and they now work a treat with my new motherboard.

Sybixsus, I have worked with that concept for quite a while now and while the engine and engine makers themselves behave foolishly with their engine by not really proper developing on the concept, nevertherless I do like the concept of what 3D RAD does(even if the programmers try to be demi gods) and I think it would be pointless to say I programme a flight simulator, if I can reuse it to do a space combat sim or even another flight sim, apart from a few minor adjusments, then the engine is reusable again rather than waste time programming another engine for a similar game or if I wish to include in a 1st person shooter flight elements, why reprogramme the whole thing again from scratch whereas if you have something like that where all the joystick axises are there if the player has H.O.T.A.S, if not , it can be controlled by just a joystick or a keyboard and mouse(which how I play most of my 1st person shooters like Quake3 and Unreal Tounament and Unreal Tournament 2003)a dnyou can have a in and out control and other things like eject control and have them in separate parts and use them when required I think it would cut down development time .

Listen everyone , I know a certain publisher is very interested in my idea's so I would really like some help please, I have requested a team before and hopefully I will get one, if this sounds like a very interesting concept, please get in touch I really also want to make this type of engine so if anyone is interested, please say so on this thread,


Gabriel(Posted 2003) [#14]
No one said you couldn't or shouldn't write reusable code. I write as much of my code as possible in a reusable format. But you have to get out of the habit of thinking in terms of brains. You have access to so much more than brains now, and you're limiting yourself unnecessarily. Read some of Red Ocktober's ( sorry if I've spelled your name wrong again, Mike ) threads around here. It was all about OOP in Blitz and how wonderful it is. He's really making the most of reusable code, but not tying himself down to his 3dRad roots.


Der Vampyr Engel(Posted 2003) [#15]
Read some of Red Ocktober's thread's OK but I still think the brains idea is a very valid one I was thinking though to actually program the vehicles and use include so that they would be tied into a main brain which would house the editor and worlds so that might be best