14-11-2003, 23:44 | #1 |
Administrator
|
An Opinion #10.... "Sour Cream"
Whilst dwelling over a forum which became so engulfed in flame it required the fire brigade, I began to wonder why one person loves one racing sim and another so passionately despises it. No prizes here for working this out for yourself of course - there's no perfect answer. This however, led me onto a further question: What components from which games would be a perfect hybrid - one which everyone would be happy about…indeed could this be possible and would we want it.........
Read the rest of this column here... http://www.racesimcentral.com/artic.../column10.shtml And remember to post your thoughts and comments here !!
__________________
Mikkel Gram-Hansen || - Always second, never winning. *sigh* Danish GPL Society || Team Leader - Admin RaceSimCentral & SIMRACER ! :D Last edited by Tim Wheatley : 05-12-2003 at 00:25. |
15-11-2003, 16:04 | #2 | |
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
You are of course, absolutely correct. A commercial product will never satisfy us all, because that's not maximising profit. Why make one perfect product when you can convince the majority to buy several products that nearly do what they want?
If it's going to happen, I'm guessing it's going to have to be developed by someone who isn't controlled by marketing (potentially nK, RL or LFS? What are Papy upto now?) or when us consumers stick together and refuse to buy anything that's less than perfect. I'm just a guilty as everyone else here - I play a Nascar game about once a year, and I consider N2003 to be worthy of a patch to N4, yet I own all three of Papy's Nascar sims.
Quote:
I'm hoping that piracy becomes so wide spread that it becomes impossible to make profit from video games / movies / music etc. Maybe then we'll just be left with people who create this stuff for the right reasons. We must be due for a miracle sometime soon mustn't we? |
|
15-11-2003, 21:44 | #3 | |
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
About the perfect racing sim...
Quote:
Reading that, one thing has come to my mind: the linux kernel. For those who don't know, it's an operating system written by a LOT of people all over the world, with no economical profit. Working on it just because they like doing it, because they want to provide an alternative to microsoft programs... whatever. What if there was something similar but with a racing game? I know, there wouldn't be _so_ many people working on it, but.. lfs is being created by just 3 persons. Also, look at racer... just 1 person. NetKar too. Look at RacingLegends... Well, now imagine there was... let's say, 25 persons all over the world working in the same racing sim. Working in a new 'game', in THE Racing Simulator. Some of them working in different parts of the physics engine, some of them modelling tracks, some of them working in cars, some of them working in sounds, others working in the interface... and then a couple of thousand testers. And anyone who could help would help. And of course, there would be someone / somepeople who coordinate the work. Do you think it's really impossible to have the perfect racing sim? Don't you think it's time to start a project together? |
|
26-11-2003, 20:00 | #4 | ||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Quote:
Quote:
The hardest part will be the core physics engine, but as you pointed out this can be handled by one person (as is the case with pretty much every other racing sim). There are people now who I know are capable of fulfilling this position but they must want to work on a GPL style project and be prepared to handle (and put with) bug reports, feature requests and (potentially) lots of abuse. The first steps will be the hardest - once some structure is in place and we have gained some interest from the current popular mod teams or developers it should be downhill all the way. I imagine the structure would be along the lines of Emacs - as little source code as possible with a good scripting engine. The scripting language would be used to define everything from the menu interface to running a championship season on a multiplayer server. Doing it this way would allow a larger number of people to tinker with as much as possible and submit updates & bug fixes. I think this method would have a higher chance of satisfying everybody since it shouldn't be too difficult for anyone to learn how to change whatever they don't like. What we need to move away from in my opinion is the concept of mods. The "now we load this carset with these physics and we can race in this championship" style. What we should have is a huge number of cars and a huge number of tracks. The interface should then let us say "I want to start a championship season running these tracks in this order, and I want to allow all car types without wings to take part" or whatever. Personally I would love to get involved in a project like this (I have lots of experience writing C, a little knowledge of C++ and a fair amount of experience with various interpreted languages) but unfortunately I know very little about implementing car physics, graphics, sound or networking. I don't think I'm ever going to be fully satisfied with a commercial sim so here's hoping some nutcase steps up to the challenge and gets the ball rolling... |
||
26-11-2003, 23:26 | #5 | ||||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Quote:
So, if possible, it would be better to have more people working on the physics engine. At least 2 persons. Keep in mind that, being this a spare-time project, we need more people to make it playable (with no important bugs, etc.) in a reasonable time. It will allow continued work, and probably better code than if there was just one person.
Quote:
Quote:
This discussion has also been present in the development of other free programs, such as eMule, and as a result, i conclude that the only "moddable" aspect of the project will be the [easy and semi-automatic] addition of new tracks/cars (+championships&similar things?). Something like racer: copy a folder and there you have it. It's good to have an internally powerful/versatile structure, while keeping a simple look/use for the end-users (for the most commonly user-modified features of the project).
Quote:
Also, i know a guy who has studied car physics for about 6 months, so he could be of help. In fact, we were about to start making a car game. I suggest we start thinking more seriously about all these things, maybe starting a new thread or something else (if it is to be a open project, good communication is needed). Let's start this project now! |
||||
27-11-2003, 09:53 | #6 | |||||||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Hi Stenyak,
Quote:
Quote:
Quote:
Quote:
Quote:
To implement car physics, it's of course more important to understand car physics than it is to write C or C++. I could probably write the code if someone could give me all the right equations! Networking I'm guessing will be the next hardest area, here experience definitely counts.
Quote:
Quote:
Please post here if you start another thread (or if there's existing ones I should read). Regards, Mart. |
|||||||
27-11-2003, 11:15 | #7 |
Moderator
Join Date: Oct 2002
Location: Japan
Age: 31
Posts: 462
Style: (Default)
|
Hi all,
Interesting thread going on here... I don't think the project is impossible but... I have to point out that it is not as "simple" as writing the linux kernel or emacs. I'm going to explain what I mean... things like a text editor and even a complex thing like OS kernel are still part of the domain of electronic and software common knowledge... Why you see so many free window managers, email applications, webservers and so on but NO (apart from some exceptions) free games, high end 3D applications, high end sound applications? Simple, because they need something more than a "common" software knowledge.. being a good coder is not enough to write a simulation.. you really need to deeply understand what you're trying to simulate... Having a team of 2 coders doesnt cut the development time in half.. just the opposite, it could actually make that time longer.. because they will need planning, coordinations, modularity... many things you can do on "autopilot" when you're on your own... as for myself.. I find the project really challenging.. sadly, as you might notice, after my move to JP I hardly have the time to fix things in nK, sure I can't join something requiring such a level of involvement... but I'm ready to collaborate anyway... being it as an outside helping hand, and with code.. things like multiplayer parts in nK are quite modular.. I would be happy to share the source code with the devs of this new project (as long they don't become public, for obvious reasons.. cheaters)... best luck anyway.. |
27-11-2003, 11:55 | #8 |
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Thanks Kunos
|
27-11-2003, 14:42 | #9 | |||||||||||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Hi Marty!
Quote:
-In the beginning of the project, the wheels spin at the speed of their side of the axis. The speed of the axis is the speed before the differential, equal to the speed of the end of the gearbox. The speed of the gearbox is equal to the speed of the crankshaft (is that the word in english? i mean the value of the rpm-meter). The speed of the crankshaft is proportional to the speed of the pistons (...the thingies of the cylinders). And this is proportional to the fuel given, equal to the value of the input (gas pedal, keyboard 'up arrow', whatever). This is a very basic and very unrealistic physics engine, probably unplayable and with missing things and maybe some others wrong (it's just an example). -The next thing to do with the physics engine would be, for example, changing the part of the "final gearbox speed equal to crankshaft" to this other "final gearbox equal to crankshaft times the current gear ratio" (or whatever math. formula is to be used). -After that, we can change "final gearbox equal to crankshaft times the ratio" to this "final gearbox equal to initial gearbox times the ratio", and then add a "initial gearbox speed equal to speed of crankshaft divided by clutch value (third pedal, keyboard 'c' key,...)". -All like this (modofying and adding new parts) until... until we want to, or... until we have a perfect simulator (well, a really-close-to-perfect simulator ). This way, we can start with a speedOfWheel=inputOfGasPedal, then make the engine better by adding more parts or changing exisintg parts with more accurate formulas/data/whatever. And also, we can have different people working on different parts of the physics engine _at the same time_ (similar to people who use libraries whithout knowing the internals of them). Just an idea.
Quote:
Quote:
Quote:
Quote:
I think we need to make the project executable in the platforms sim-racers mostly use. That means Windows should be supported (not that i like it, but would help to attract more possible contributors to the project). And also Linux. I think those are the two most important o.s. nowadays. However i don't know how many people use BSD, MacOS, etc. We should think more about how to approach this. IMO trying to make the game compilable under several (too many) platforms will make it harder to enjoy the development of the project itself (i mean the real interesting things: physics, gfx...).
Quote:
Quote:
Quote:
Quote:
But beginning to think how to do the car game, i realized i would need some help with the physics. Then i realized i had no idea about creating a gfx render engine... Even if there's some time lost in communicating with the rest of the coders, it's better for them to know about what you do. I think it's better to have the project with several people working on the same areas (at least in really _similar areas_). That way the work will not be interrupted if the 'main' coder can't keep working on it, or if he decides he's tired of it, or whatever. As i said i expect this to be a dynamic project, not dependant on one or two coders, but on the community.
Quote:
I always thought there was no uncrackable code (via reverse engineering, not force attacks), but then i read about the autentification system used in linux (coding the pass based on the pass itself). Maybe there's a way to make cheating difficult even with the code available. Anyway, if the source code is versatile, then the dev team (the coders) could work in (share between themselves) the multiplayer secret-code, giving the community (users and such) access to the _binaries_ of it. Of course, this would require the coders not to reveal the source code of the multiplayer part. Maybe the community is loyal and can be trusted with no need for spending too much time on anti-cheat code. Anyway, there's plenty of time to think about it. First we need to do many other things.
Quote:
edit: As a reminder (phew long post above! ) : now we must focus on finding a way to coordinate the efforts. Please write suggestions about what i've said (rsc forums, sourceforge,...).
__________________
Petition for a Software Patent Free Europe MOtorSPort - the Racing Enthusiasts Vehicle Simulator Last edited by stenyak : 27-11-2003 at 18:21. |
|||||||||||
27-11-2003, 19:55 | #10 | |||||||||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Quote:
Simple is good (to begin with), so yes that's the right approach. From what I've read modelling most "parts" of a car isn't too difficult and I think it wouldn't be too long before we had something that felt like a reasonable approximation of driving a car. Aerodynamics I guess wouldn't be too complicated either as I think it's more "common knowledge" as Kunos put it. However, the problem is going to get proportionally (exponentially?) harder the closer we get to reality. The big area of black magic would appear to be the tires.. the tire model is going to be the killer I think, where someone with experience and expertise will be required. I imagine beta testers will be the major contributors here, but it's not going to be easy as I expect most testers are going to be saying things like "it feels like the flywheel is sticking when I'm off throttle approaching this apex changing from 3rd to 2nd and the slip angle is sub-optimal for the corner" or whatever. Someone has to interpret that and understand what it means in terms of formulas. There are of course many other issues - I have no idea how collision detection works for example. Oh, and of course I have a full time job eating up a large chunk of my time and killing my enthusiasm for writing MORE software when I get home...
Quote:
Quote:
Quote:
Pah, what the hell... I think we should just beat him with a stick until he agrees to let us use it as a starting point
Quote:
Quote:
BSD has support for Linux binaries, and yes (I believe) most Linux code will compile under BSD with little problem. I'm only just starting to look at BSD so I don't know for sure though, but I think Linux & Windows are the only important OS's that we need to worry about (MacOS is based on BSD so if Linux is supported pretty much every other OS should be an easy port anyway). Not completely relevant, but if you haven't seen it Cygwin is an excellent environment that would allow the same build system and tools (eg Perl, a personal favourite) to be used. Obviously the main code should be built on Windows with MVC (not gcc) for best performance though.
Quote:
Well not quite, but I don't think this project is going to go anywhere unless someone with far greater knowledge than both of us is interested.
Quote:
There are existing projects such as OpenAL, OpenDE and SDL which may be of use.
Quote:
Anyway, Linux (open) has far better security than Windows (closed) so that shouldn't be a problem. In fact being open source can help as it means any exploits are generally picked up far quicker. BTW, it wouldn't bother me if this wasn't an open source project. As I mentioned earlier, I think much of the "code" most people want to play with can be pushed into scripts anyway. If this method would allow us to use say a network module from someone else then all the better. |
|||||||||
28-11-2003, 16:32 | #11 | |||||||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Quote:
Quote:
Quote:
Quote:
Quote:
That's my idea. If nobody wants/can join the project, i will start with no help. Probably the first thing i'll do is buy a book on using opengl under linux
Quote:
Quote:
|
|||||||
29-11-2003, 12:14 | #12 |
Administrator
|
wow guys please keep this discussion going, it's highly interesting !
__________________
Mikkel Gram-Hansen || - Always second, never winning. *sigh* Danish GPL Society || Team Leader - Admin RaceSimCentral & SIMRACER ! :D |
29-11-2003, 18:41 | #13 | ||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
On a side note, went to see Ben Harper last night... damn he's good
Anyway, ...
Quote:
I'm therefore only interested if there is at least some probability of bringing the race sim community together on this and making something at least on par with the combined forces of LFS, GPL, netKar and NK2003. Personally I wouldn't start from scratch - maybe RARS. It's usually much easier to think about what you want to achieve by modifying something that exists than starting over. Plus most of the really dull ground work is done. As we've already discussed though, the success of this depends on the community and the fact that this thread has been viewed 130 times (at the time of this post) and there's only two of discussing the idea suggests to me it's not going to work. Ok, some ideas and suggestions: * Get the interest of people such as Brian Beckman or even Maxx. i.e. people with a technical background and real life racing experience. * Get the GPLEA team to finish the '67 cars without the need for any of Papys original work so they can be included in the new sim (would help to gain interest I think and allow many people to directly compare the physics of the new sim with GPL). * Give Ruud, the LFS, RL and RBR teams etc a prod and see if they're interested in something like this (I'm not adverse to the idea of the perfect sim being a commercial project, and note it IS possible for something to be open source and make profit from it). * Start a website calling it something like the Racing Open Standards Group or whatever, (rosg.racesimcentral.com ) using a name people will remember and get the ball rolling. "If you build it, he will come." * I'm trying to think if it would be possible to get any real racing teams involved in making an "America's Army" for the race sim world ...
Quote:
Last edited by Tim Wheatley : 05-12-2003 at 00:29. Reason: removed bullet points cause they screw pages up |
||
29-11-2003, 20:07 | #14 | |||||||||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Quote:
Quote:
Quote:
But the problem is still there: i haven't made any program similar to this project; this is a huge project! As i said, if i am the only one interested in [doing] it, then it will take a lot of time (probably several years) to get to a 'finished' state, no matter if i start from scratch or not. I prefer to know what does everything do, not just using a 'black box' that magically makes some cars appear on screen.
Quote:
If this thread was stickied into all sub-forums, i guess the number of replies would change. Anyway, we don't need people posting a lot of "this is a cool idea" and such (at least in this thread). We already know that . What we need is to start a project in sourceforge (do you agree?), do some basic code, then post a notice in these forums (any place where people can easily see it), then let people put their feature requests, their "this's cool", and their applications (is that the word in english?) to join the dev team. Better if they do the latter.
Quote:
Quote:
Do you mean, telling them if they want to develop this project?
Quote:
Quote:
Quote:
I get this conclusion:
__________________
Petition for a Software Patent Free Europe MOtorSPort - the Racing Enthusiasts Vehicle Simulator Last edited by stenyak : 29-11-2003 at 20:12. |
|||||||||
30-11-2003, 04:38 | #15 |
Moderator
Join Date: Oct 2002
Location: Japan
Age: 31
Posts: 462
Style: (Default)
|
I agree with Marty and I dont think Stenyak's approach is correct.
The original idea of the thread was to create a combine effort that could put together someone who already proved his/her (I wish there was an "her" in racing sim developing lol) in other products.. Stenyak's idea looks to me like the other 5-6 indipendent racing sims popping up around, it looks like every racing sim website has "its own" racing sim under development.. it is kind of funny.. but I understand the feeling because I went "oh, well.. nevermind I'll do it by myself!" too... But Stenyak's plan looks like a recipe for failure really.. 2 points in my opinion are a big "no no": 1) You say OpenGL under Linux, and it is a BAD idea... for a project like this you need to MAXIMISE time usage and make it as simple as possible for the user to try your game. From the time point of view, Linux game development is virtually non existent.. every racing sim out there is for Windows, 90% of them are DX based.. the reason is: because it is a better environment to develop.. it is easier to find infos around... and when you need integration with material coming from other software you can run it on your machine (3D studio, photoshop, sound editor ecc..).. Plus the user.. Linux is a pain in the ass.. do you really want to force someone to install an OS to use your sim? 2) The idea of "starting with a 2D sim then evolving it into 3D" is suicidal.. .pure and simple. I can assure you, it will not work.. I did the same mistake 4-5 years ago. The way to do it is to build a basic physic engine you're happy with (3D of course) THEN think about cars and racing, not the opposite. You can't fake physics.. it is not a process of make things more and more complex as you go... it's the opposite.. it is creating a basic environment that you use to build upon.. in other words you go from the complex bottom part up to the racing simulation.. not the opposite.. from the racing sim down to the difficult physics parts.. The more code you create, the more difficult it will be to modify it. I strongly recomend you to abandon this course. all of the above is, of course, IMO... EDIT: Just as an example of what I am saying.. look what Chris West is doing... he's not putting together a simple 2D physics engine to make screenshots and then develop the rest.. he's doing the BASIC physics part (with Gregor) first... then he will move into the "game" part.. Last edited by kunos : 30-11-2003 at 04:41. |
30-11-2003, 10:55 | #16 | |||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Quote:
Also, i think that more and more people will begin using linux. It's just a matter of time. Right now linux can be difficult to install and configure, but IMO in 2 or 3 years things will have changed, and it will be easier for the users.
Quote:
Maybe i should emphasize that, whatever i say here is not to be taken as "truth" or as "what will be done". They're just ideas, suggestions. After all, the idea of this project is from simracers for simracers; I don't want it to be just _my_ project, otherwise i wouldn't have said anything in this thread. Maybe the problem is that i'm the only one who is actually going to code, at least in the first steps of the project .
Quote:
The thing about doing a 2d engine then a 3d engine, maybe i should have explained more my idea: what i say is that, in order to have something working, it seemed for my easier to do a basic 2d engine (and by 'basic' i mean speedOfCar=gasPedalInput;angleOfCar+=steeringWheelIn put) in order to have something working. After i check there's actually something in the screen, doing what it's meant to do, then i can start doing the real 3d engine. The 2d engine is just a way to climb the big wall i talked about. It just seemed to me (and still seems ) to difficult to begin directly with collision detection and physics engine under a 3d environment (if you want the car to lay on the ground without wheels, collision detections is needed... am i wrong?). Anyway, i thank you kunos for your comments, it's good to have somebody giving advice |
|||
03-12-2003, 16:35 | #17 |
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Hello everybody! (is anybody still here?)
I have been doing some things these days, from learning some generic opengl things to learning some basic sdl. I have also been creating some basic code, just as a test (or maybe the beginning of the project ). However i have some questions that, hopefully, somebody can answer. (BTW: the code is supposed to be compilable under windows and linux; haven't tested it under windows though) -Firs of all, what useful places do you think i should visit (irc channels, newsgroups, websites) in order to get answers for these (see below) kind of things? -Should i use several threads for every engine (gfx, snd, physics, input and net engines)(i call them "engines", dunno if that's correct), or is it better to make separate functions and call them from a main loop (iteratively, not in paralell)? I'm making every engine independent from the others, but obviously they share some specific information with others. The relationships are these: ·the gfx engine will read data from the phx (=physics), input (showing the input in screen like LFS) and net engine (chat messages and such). ·the snd engine will read data from the phx engine. ·the phx engine will read data from input and net engine (in order to know the position of other cars in multiplayer). ·the input engine will read data from phx engine (force feedback) ·the net engine will read data from input (chatting...) and phx engine (in order to send our own car's position, etc.). The engines can write their own data and read (not write) any other engine's data (if allowed by the relationship above). I don't know if i should create another engine, the 'game engine', which manages the intro/outro, menus, and the rest of the engines (synchronisation, etc.). -And the last question: any suggestions for the name? (i need one in order to create the sourceforge project and have a place where to discuss this and other things). I suggest some: TRS - The Race Simulator URC - Ultimate Race Simulator ORS - Open Race Simulator ODS - Open Driving Simulator (it's not all about racing, right? we can also watch the landscape...) NJARC - Not Just Another Race Simulator ...maybe they're not good names, but i don't have any better ideas |
03-12-2003, 17:14 | #18 |
Administrator
|
I'm still here, and I'm still interested
__________________
Mikkel Gram-Hansen || - Always second, never winning. *sigh* Danish GPL Society || Team Leader - Admin RaceSimCentral & SIMRACER ! :D |
03-12-2003, 18:04 | #19 | ||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Quote:
Quote:
Open Driving Legends (OpenDL) Fake Driver (cos it ain't real, it's a sim innit?!) Rubber Soup (or anything completely unrelated to what it is) Bland Driven Auto: Open City Mikkel - I'd be interested if you have any comments / thoughts / suggestions about this thread, as a veteren / administrative RSC member |
||
03-12-2003, 18:30 | #20 |
Administrator
|
Will think and see if I can add anything usefull even if this is not up my usual alley, I'm a boring administrator/politician not a gamebuilder... but the name is easy
"The RSC" Project RSC The RSC Driving Experience Community Driven Drive The Experiment Racing Incident Project Apex The RaceSim Project The Collective Effort Naaaahh grasping at straws here... I'd usually make a thread asking peoples opinion and making it into a contest.. best proposal for a name wins a small prize. I don't have any real cool names bouncing in my head right now, but I would love for it to become a RSC pet project.. something we devote a lot of time on following and helping as best we can. I'd love to follow the process as much as the actual product, might be an extremely interesting lesson in teamwork and game development.
__________________
Mikkel Gram-Hansen || - Always second, never winning. *sigh* Danish GPL Society || Team Leader - Admin RaceSimCentral & SIMRACER ! :D |
03-12-2003, 21:03 | #21 | ||
Registered
Join Date: Mar 2003
Location: Spain
Age: 19
Posts: 834
Style: (Default)
|
Quote:
But the sound engine can also interfere with physics... if we are gonna use threads, wouldn't it be better to use it with all the engines? or at least with the most cpu hungry (do you understand what i mean) ones? If it's going to be a sim, the sounds will also be rendered in real time (similar to what lfs does), so the snd engine can eat a lot of cpu. Anyway, i have already made a gfx and phx engine (basic ones), and they work iteratively (not with threads), although they are independent (well it seems to work). This is the code for the engines management (all the code i post is opensource, unless i say otherwise). The code gives priority to the physics engine; the [max] speed of the gfx and physics engine can be specified in steps per second (or fps):
Code:
TickCount = SDL_GetTicks(); // Get Present Ticks (time since the program //started) //code for the physics engine management-------------------------------- if(TickCount-LastCountPHX<(1000/100)){ // We check how much time has //passed: 1000msecs/100FPS (call the physics engine //every 10msecs, 100times per second->100FPS) if(phxDone==false){ // If we haven't already done the phx //calculations in this period of 10ms, do them UpdateInd(Keys); // UpdateInd(Keys) tells the phxEngine to do 1 //step, provided the input has the state of 'Keys' phxDone=true; // state that we have already done the //phx step of this period of time } }else{ //if the current period of time has expired... if(phxDone==false) //if the phx engine hasn't still be called... UpdateInd(Keys); //...then call it (make one phx step) else //otherwise (if we had already done the phx step //of this period) phxDone=false; //reset the period of time LastCountPHX = TickCount; //keep in memory the beginning of the next //period of time phxFrames++; //increase the count of phx steps done in //this second } //code for the graphcis engine management---------------------------------- if(TickCount-LastCountGFX>(1000/36)){ //now check if it's time to do a graphics step //(we want 36 gfx frames per second, that's //a gfx step every 1000/36 msecs.) if(phxDone==true){ //do nothing if we still haven't done a physics //timestep (there are better things to do than //drawing gfx) Draw(Screen); //do one gfx engine step SDL_GL_SwapBuffers(); //and swap buffers (this is for double //buffering, it avoids some screen flickering) gfxFrames++; //increase the count of frames we have done //in this second LastCountGFX = TickCount; //keep in memory the beginning for the //next period of time (1000/36 msecs.) } } //code for the fps displayer-------------------------------------------------- if(TickCount-LastCount>(1000/1)){ //this is for drawing the fps of the gfx //and phx engine. updated every second //(1000 msecs.) sprintf(titulo,"gfxEngineFPS=%i - phxEngineFPS=%i",gfxFrames,phxFrames); SDL_WM_SetCaption(titulo, NULL); //put both fps as the window title gfxFrames=0; //reset both counters to 0, ready for the next //1sec. period of time phxFrames=0; LastCount=TickCount; //keep in memory the beginning for //the next step of this fps displayer } In my computer, i have been able to run this code at about 485fps (gfx engine) and 960fps (phx engine; maybe it's better to call it Hz instead of fps). Or a steady 36gfx fps and 975hz for the phx engine. Well, this is just with _very_ simple engines (it's just three 2d images moving in the screen, and a very simple 3d object (8 polygons) also moving in the screen, under opengl. I have a AMD1000, plenty of RAM, GeForce2GTS (agp2x), and the code has been run under linux. There's a problem: the SDL tick counter is not very precise when using small quantities of time. I have read it's possible to get a precision of 1ms under linux, and 2ms under windows. That means the physics engine will run at a max. rate of 500Hz (in order to have compatibility with windows. otherwise, it would be 1000Hz). I have read that NetKar's phx engine runs at 333Hz. If we want to make this the definitive sim, and if therefore we need to do calculations of engine parts in real time, i guess this is not gonna be enough (think of an engine running at just 3000rpm, that would require _at least_ a 3000Hz phx engine, probably about 12000Hz for the rotatory movement of parts, etc.). We will have to simplify some formulas. Or we'll have to search for another portable library that let's us more than 1ms precision. However i'm afraid that this limitation has to do with the o.s., and not with the library (not sure about this; do you have any idea of this, Kunos?). That's something i don't like about computers: they'll never be fast enough... for this project .
Quote:
About the name: doing a poll is a good idea. It would help promote the project, but i would feel under pressure. And if someone offers to help.... well my code is still just testing (i'm doing some code in order to see what can be done and how)... so... well... the thing is, i'm still not prepared to start the project, i need some days (probably weeks, a month or so) before i can finally start working in the project's real code. If we make an announcement right now, some people might want to code, and since there's still no real/useful code, they would start from scratch... and i would be left aside, still learning things... and i would like to be doing something in this project.... i don't know if i have explainned well... Post your thoughts about all these things.
__________________
Petition for a Software Patent Free Europe MOtorSPort - the Racing Enthusiasts Vehicle Simulator Last edited by stenyak : 04-12-2003 at 21:10. Reason: error in code |
||
03-12-2003, 23:29 | #22 | |||||
Registered
Join Date: Nov 2002
Location: United Kingdom
Age: 26
Posts: 374
Style: (Default)
|
Quote:
It's therefore really more a case of whether your calling asynchronous (non-blocking) functions or synchronous (blocking) functions. Mix_OpenAudio and Mix_LoadWAV for example may take some time to execute, but that's ok because you'll probably only call them before playing the game, not during.
Quote:
Think about networking and the physics for example - one 'tick' of the physics engine will take the drivers and other car positions as input, do it's math and output the drivers new car position. There's no point in gathering more network data while the physics are calculating since we can't use that data until the next tick starts. Logically it would therefore seem to me that a separate process to handle network traffic isn't required. If we need to call a function that waits until it receives some network data then of course we'll need another process for that. But, I imagine this will be handled asynchronously by events / callbacks or whatever. Your event / callback may take some time to execute, but that'll be running in the context of whatever process SDL called it with. Hmm... I hope that makes sense!
Quote:
The benefit of this method would also be that if all the work in your function is completed well within the tick period then it won't spin wasting CPU time, waiting for TickCount to become a big enough value in order to do something again. I'm only guessing here though...
Quote:
Quote:
If you do want it to be a community project (like me) then your going to have to give way to other people taking control and stop thinking "this is my design" or "this is my C function". You can't get upset when someone rips out your 1000 line masterpiece and replaces it with their 5 line alternative that works better and runs faster. |
|||||
04-12-2003, 00:48 | #23 |
Moderator
Join Date: Oct 2002
Location: Japan
Age: 31
Posts: 462
Style: (Default)
|
dont use threads. they slow down the app and introduce a huge number of complications.
Sound engines are by nature multithreaded... and that's all you need really.. but make sure you have a system in place to "simulate" threads within your app.. so you can decide which frequency you want every subsystem to work.. |
04-12-2003, 13:12 | #24 |
Administrator
|
Check the announcement on the front of RSC.. http://www.racesimcentral.com and let me know if I said anything wrong
Once we have a name I'll be more than happy to open a new forum for this project to live in.
__________________
Mikkel Gram-Hansen || - Always second, never winning. *sigh* Danish GPL Society || Team Leader - Admin RaceSimCentral & SIMRACER ! :D |
04-12-2003, 13:56 | #25 | |
Registered
Join Date: Dec 2002
Location: Australia
Posts: 505
Style: (Default)
|
Quote:
Hi Mikkel how about we recruit 100 ppl to be involved and call the project "100 Mikkel Drive" I can always write the manual? haven't heard from your reviewers yet have later release available too ShannonN
__________________
SHANNONN - 2IC - PROJECT DEVELOPMENT OFFICER WEDGE TAILED EAGLES |
|
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|