3D Network Space Game
Blitz3D Forums/Blitz3D Beginners Area/3D Network Space Game
| ||
As the title of this thread states, I am attempting a 3D Network Space Game. 1. Is it possible to run two 3D programs in Blitz at once? For testing, I want to run the program once in debug mode, minimize it, run another copy of it, and see how the two programs interact, but unfortunately whenever I try to run the second code I get the following error: "Unable to Create 3D Scene." Is there any way to do this? 2. Since I want my ship to behave like a normal spaceship, when I use the thrust, the ship should move forward. However, when the ship turns and thrusts again it will not change direction completely, but rather move in a combination of two directions. I could not think of any way to do this using Blitz's TurnEntity and MoveEntity commands like I normally do. Do I have to use Sines and Cosines to achieve this effect? |
| ||
1. Yes it is possible. You may have to have multiple sessions of the IDE running though if I remember correctly. 2. Simple way is as follows : store the ship's velocity for each component (ie velocityx,velocityy,velocityz), when thrust is applied multiply the unit vector pointing in the direction of the ship by a 'thrust value' (tformnormal 0,0,1,shipentity,0 to get the forwards vector of the ship in world coordinate space) and add this value to each of the velocityx/y/z values. You will likely also need to limit the ship to some maximum velocity otherwise it will reach a too high velocity. if 'thrust applied' then tformnormal 0,0,1,shipentity,0 velocityx#=velocityx#+tformedx()*thrustamount# velocityy#=velocityy#+tformedy()*thrustamount# velocityz#=velocityz#+tformedz()*thrustamount# if sqr(velocityx^2+velocityy^2+velocityz^2)>maxvelocity# then totalvelocity#=sqr(velocityx^2+velocityy^2+velocityz^2) velocityx#=velocityx#*maxvelocity#/totalvelocity# velocityy#=velocityy#*maxvelocity#/totalvelocity# velocityz#=velocityz#*maxvelocity#/totalvelocity# endif endif translateentity shipentity,velocityx,velocityy,velocityz |
| ||
Thanks. Do I need to update to the newest version of Blitz to solve my first problem maybe? |
| ||
Yeah...that would be the problem...also you don't have have to sessions of the IDE running, you just have to click the compile button twice |
| ||
Still doesn't work. Must be my graphics card... it's very old. It doesn't even work when I run a 3D game, and then run Blitz. |
| ||
Well, I've diligently kept working at it, and now just about every part of the code doesn't work. Hooray. |
| ||
How much graphics memory does your card have? You might run low on graphics memory then. Your program tries to create a graphics display, for which not enough graphics memory is available. That might cause the problem too, I think. I created a 3D maze program with default resolution of 1280x1024 and tried it on my friend's computer, he got the same error. His graphics card couldn't handle that resolution. Yours might handle it for one program, but not for 2 at once. You can also try to run your space game at a lower resolution (i.e. 640x480) and run that twice. If that works, then you're just low on vid-mem. |
| ||
I'll try it. Thanks. |
| ||
If you're trying to run two debug sessions at once on the same machine... with an old graphics card... you're going to be watching a slide show. |
| ||
Well, a slide show's better than guessing as to whether or not my program works! |