Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Dark Basic Pro Game Programming Idea

Author
Message
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 9th Dec 2002 07:18
Hi everyone
As most of you know by now I am a very controverisal person on this group. My ideas are far from radical but they might seem a little hard to bear.
Anyway, I have come up with a solution to all my problems as I go along developing a game.
One of the problems that I have run into is re-writing code for the same thing over and over again. Take a game for instance. What if I wanted to reuse stuff over in different games? This has forced me to come up with a solution.
This solution is not radical in any shape or form, but it's any idea I share.
One of the things I see with DB/DBPro/BB is that people tend to develop the entire game right on the spot in the code. They only seperate few things from the game code itself, but not the core components. While this is not a problem if you are only developing a single game, what if you wanted to make multiple games with the same core components. So what I have decided to do is develop an engine. While it might not be a true engine, it will still handle the common stuff for me. Basically what I am doing is creating a seperate dba file, including functions for anything and everything that needs to be handle for the game. Then when you make the game, all you do is include the engine file into the main game project and use the functions within the game project.
Now, that sounds a little complex for some people. You will say, well your game is going to run slower with a lot of function calls. That might be true, but I think with future updates to Dark Basic Pro, it should be faster. By the way, this is going to take some time for me to do this, but when complete it should be able to handle a couple of games until it needs an update to the code to handle different things.
Another point I would like to make to this is that it would add organization. I wouldn't want to make an entire DBA file unorganized. So what I am planning to do is to organize it into the parts that make an engine important.
Now what those parts are shouldn't be hard to figure out. I have already done so.

Some of you may follow my lead and do what I do. Most of you probably won't. It doesn't bother me if you don't, but I would like you to think about doing something similar.
The one thing I like the most about this approach is organization. The con to this is that it will take some time to do all of this. For some, the level that I want get to might be too much. For them, I would suggest ether doing it their way or try getting to a level that is just right for what they are doing. The engine approach isn't for everyone.
Just an idea to consider.
SoulMan
I am my own and own my am I
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 9th Dec 2002 14:59
RE-use of functions is the point behind many modern high level language features, such as functions, types, and (for OO languages) Classes/Objects etc. After all this very re-usablility is at the heart of the Visual range of development tools, the libraries there have all the code needed for making windows, buttons, lists etc so you don`t have to write them yourself (it also gives all windows apps written in VB or VC++ a common look and feel).

The approach you mention is a good one for increasing development speed (after the first game that is, in theory the first one will take longer, the later ones should become gradually easier as your library of functions develops).

There are problems with this approach when used for game coding. Constant functions calls compared to embedded code could have an effect on game speed (as you mention) but, more significantly, trying to write generic functions that can handle all possible uses can lead to very inefficient code (I`m sure Lee could tell you all about this ).

The method I have started to employ is to keep what I would refer to as code 'templates' - these are small pieces of code (basically functions), often lifted straight out of my main source code, that demonstrate one particular functionality, such as camera control, or a generic Mouse/Joystick/Keyboard handler. When writing a new game I lift out the pieces of code I require, dump them into the new code and then adjust them as necessary to integrate with the new game. This helps keep them efficient.

Your way of doing this has some advantages, instant useability being one. Another point is that once you have a function 'mapped out' in DBPro, if you find your using it allot, you might want to take the time to re-write it in C++ or Delphi or whatever to speed it up and then plug it in as a DLL instead. A few months of this and you might end up with an engine existing almost entirely in DLL`s with DBPro acting as a graphics front end and central control, which would be cool!
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 9th Dec 2002 19:38
Yeah, version 1 of the engine is going to be all DBPro while version 2 is going to be a DLL version which will better because then I can get straight into game design by including the DLL's. Now what I might do with the DLL is break it up into five dll's that cover what I consider the important stuff like

A.I.
Physics
Graphics
I/O
Sound
Now one of the things that I have also discovered is that if I take this approach, I cannot hardcode anything into the engine. A good engine will only take data, calculate it and return values as needed. A bad engine will have functions that call back to the game or just have game related functions built within it. I am going to keep myself from doing that.
Also, I am guessing that with the above five, the most work I will be doing is in A.I., Physics and Graphics. In fact, with Sound and I/o Being generalized in Dark Basic Pro, those sections may contain few functions as 5 or 6. Graphics might be the same way, but I would like to use some of the functions for 3D and plus the fact that the Graphic part will handle GUI/Console/HUD, that might be why it takes so long.
The first part I am working on will be the GUI, then the Console, then the HUD, but I will have to watch out as I will need to make it flexible for any game we make.
Simple as that I guess.
Talk to me in 6 months and ask my opinion then
SoulMan

I am my own and own my am I
Hilmi2k
21
Years of Service
User Offline
Joined: 29th Nov 2002
Location:
Posted: 9th Dec 2002 22:44
A game engine is not as simple as that, I found a document somewhere online, let me find it and post it here for you.

it is not recomended for those with no courage to go through it all

rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 9th Dec 2002 23:11
SoulMan- You are exactly right, that is what a good engine should do. The Quake engine for example. You can use iD's software to build your levels, use their scripting language to make things work, and voila, a BRAND NEW game. Now THAT's a good engine.

-> It's also the idea behing on of my little secret projects. Everyone seems to want to make an RPG, but no one wants the hassle of coding one. So I... I can't tell you

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 9th Dec 2002 23:16
Well, actually, you are talking to the same guy that wants Object Oriented Programming put into Dark Basic Pro. If I have the courage to say that, then I have the courage to do this. Besides, I know what the engine is suppose to do. I'm not some n00b little 13 year old on my Dad's computer hiring guys on the internet to do my work. If I was, then I wouldn't get anything done. Nor would I have the skills of a good programmer. Ever seen a 13 year go for Functions over Gosubs? When I was 13 all I used was Gosubs and Goto's. Now that I know TRUE programming, it's not as hard as one might think. The only thing that might drive me crazy is figuring out the engine in terms of it being Data driven. That's why I said, ask me in 6 months of my opinion on the engine.
SoulMan

I am my own and own my am I
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 9th Dec 2002 23:20
rapscallion, I can already guess at what you are making. You are making a program to make RPG Games. Am I correct? You gave too much away in the sentence if that is the case. That would be interesting to see. Of coure there are RPG Creation tools out there already.
I suggest you take a look at least at rpgtoolkit. You should be able to get some good ideas from that.
www.rpgtoolkit.com
SoulMan

I am my own and own my am I
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Dec 2002 23:21
Reuse is need not just in the engine, it's needed in the tools as well.

How else will we be able to configure that AI module you're gonna write?
Hilmi2k
21
Years of Service
User Offline
Joined: 29th Nov 2002
Location:
Posted: 9th Dec 2002 23:33
http://www.flipcode.com/tutorials/tut_el_engine.shtml

here is a good reference for the basics of the design of a 3D engine, I did not intend to make you look bad or anything like that. I am just saying that according to what I read on that link, there seems to be more to it

BTW, I have been programing for 3 months, and I already use functions and have arranged my code so that it is easy to reuse.... not exactly a game engine.. but I am making standard functions for control, these could easily be adapted for space type games or games tied down by gravity such as a racing game.... I have functions for AI, currently very basic and I have functions for commonly used maths such as calculating distances. I have not put in audio yet... I am leaving that for last.

I payed my old phyisics teacher a visit and we had a bit of a talk. Currently my movement functions support all sorts of stuff, but I am yet to add factors such as friction aerodynamics, thats currently beyond me and I guess it will stay that way for some time.

my biggest headache now is vectors, I dont understand how db handles them. I dont know for example how to express using darkbasic a vector of magnitude MAG# origin X,Y,Z and direction of AngleX#,AngleY#,AngleZ#

SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 10th Dec 2002 06:05
Hilmi2k - that's a good article to read on engines
IanM - Yes, you are right, it's a good thing I know Visual Basic. At least that language is good for spitting out cheap and dirty programs to do stuff with. When I learn C++, I will convert all the tools I write to it.
SoulMan

I am my own and own my am I
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 10th Dec 2002 11:16
rapscaLLion - Are you actually going ahead with the RPG designer thing? The reason I ask is that, after finishing dungeon seige, I thought 'wheres the editor, this really needs an editor' and started to think about how to build one.

I came to the conclusion that an OO language would be much better for writing such a game (consider all the different objects, many with similar characteristics, its just crying out for inheritance and polymorphism, sniff, sniff do I sense a flame coming?) and as such put the idea on hold until I have more time or other projects have moved aside.

If your thinking along the same lines then I will put the project even further back- 'on hiatus'- for the timebeing.

It won`t be the first time this has happened with me, I was writing a bouncing ball game, then 'Tito the Bouncing Alien' appeared, which looks too similar to what I was doing so I dropped that project.

I am now working on .... hang on, no, I think I`ll just keep quiet on that, despite its being a pretty small project.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 10th Dec 2002 11:17
'after finishing dungeon seige' - I mean playing of course, I didn`t write the thing.
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 10th Dec 2002 16:27
I agree with Soulman. I am currently working on a MASSIVE project in a similar vain, which should help newbies, and people with no time! lol Its kinda hush-hush and won't be out for a while, as I'm working on loads of projects at once (grr I always do that!) All I can say is watch this space!

* If the apocalypse comes, email me *
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 11th Dec 2002 23:32
"I'm not some n00b little 13 year old on my Dad's computer hiring guys on the internet to do my work. If I was, then I wouldn't get anything done. Nor would I have the skills of a good programmer. Ever seen a 13 year go for Functions over Gosubs?"

lol.
Why are you so eager to point out that your older than 13?
How old are you by the way?

Ogres have layers.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Dec 2002 23:55
ive just turned 14 and i love functions and prefere them in some ways

xxxpetratxxx
B. R. W
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Dec 2002 23:57
dungeon seige, is that anything like dungeon master??? dungeon master is a great game

xxxpetratxxx
B. R. W
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 11th Dec 2002 23:58
Heh, I'm 21. Still trying to figure out what beers are good. Fosters ok, but I still like Miller Lite.
I was just pointing it out so people know I'm serious about what I am doing. Otherwise, they would think that.
SoulMan

I am my own and own my am I
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 12th Dec 2002 10:32
Don`t get me started on beer, I`m a real ale guy (as any older coder should be!). Frankly you should avoid that fizzy crap, it all full of preservatives anyway

Dungeon Seige is an RPG but without all the hassle of having to keep everyone fed. It has great graphics, goes on for ages (but keeps changing), is seemless (it never stops to load the next level), has a great character development method and is also nicely ramped.

Only down side is its from Microsoft, so your putting more cash in Bill Gates` pocket if you buy it.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 12th Dec 2002 15:32
SoulMan:
"I was just pointing it out so people know I'm serious about what I am doing. Otherwise, they would think that."

Ah, I see.



Ratty Rat:
Nah, stout is better. Or a bitter once in a while.

Ogres have layers.
Hilmi2k
21
Years of Service
User Offline
Joined: 29th Nov 2002
Location:
Posted: 12th Dec 2002 20:29
hey, no need to get over excited about soulman, I found his reply a bit over excited too... so I just pointed out to him that functions are not things only pro's use.. it all depends on who taught you programing.

Login to post a reply

Server time is: 2024-05-07 12:46:11
Your offset time is: 2024-05-07 12:46:11