SyntaxBoom

General Category => Worklogs => Topic started by: RemiD on Jun 14, 2025, 09:37 AM

Title: rocketships racing 3d
Post by: RemiD on Jun 14, 2025, 09:37 AM
rocketships racing 3d

hi 🙂

i have had this idea for a while but never took the time to work on it.

the idea is to make a racing game which would represent the trading positions of investors and the events which happen in the world (good or bad), and the impacts on the sentiments of the holders, and then on the prices, on the crypto currencies market.

-in the crypto currencies market, there is the famous quote 'to the moon' which is represented by a 'rocketship' 🚀,
therefore the race will be from the earth to the moon.
-there will be different participants (in rockeships).
-there will be events which can slow down or speed up participants, or give losses or gains to participants.
-there will be armors and weapons to protect from or to damage others participants.
-there will be powerups like turbo or slow down time.

that's the initial idea.

and i have discussed a little about it with chatgpt, and then i have asked it to create an illustration of what we discussed, and here is the result :
(https://www.syntaxboom.com/forum/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Frocketships-racing-3d-20250614-ChatGPT.jpg&hash=d6d3babecc61780b18bd99a1b7bd7aa0cf384894)
(the text is in spanish because i talk in spanish with chatgpt...)
nice and coherent, i think, 🧐

let's see how far i can go this time 🔧🪛🤓
Title: Re: rocketships racing 3d
Post by: Dabzy on Jun 14, 2025, 09:42 AM
I know nowt about Crypto stuff really, but seems an intriguing idea none the less, it'll be interesting to see how it pans out!

Good luck with it!  8)

Dabz
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 14, 2025, 09:56 AM
Is it going to be sorta text based with 3d images or you actually traveling through space? with Crypto Currency, Race to the Moon.

There's a British Sci-fi series called 'The Ark' were there racing towards another habitable Planet. There are many scenarios that happen on the way?

Baggey
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 14, 2025, 10:30 AM
Quote from: Baggey on Jun 14, 2025, 09:56 AMIs it going to be sorta text based with 3d images or you actually traveling through space?
it will be a 3d racing game, using rocketships (which represent the positions of holders of financial assets) to go from the earth (which represent the bottom, the low prices) to the moon (which represents the top the high prices), avoiding obstacles (asteroids, gazclouds, other ?), and being helped or hindered by events which happen in the world which can impact the sentiment of investors and therefore the prices and the trading volume and the volatility in these markets.

it could be quite orginal, but how to implement all of these concepts and make it fun to play at the same time. 🤔
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 14, 2025, 10:35 AM
Did you finish the santa clause game?
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 14, 2025, 10:48 AM
no. and this is off topic, so don't post about this here, please.
Title: Re: rocketships racing 3d
Post by: 3dzForMeStill on Jun 14, 2025, 11:20 PM
Crypto Monedas - looks cool, I look forward to seeing how it progresses RemiD  8)
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 14, 2025, 11:34 PM
'crypto monedas : carrera hacia la luna' ( in spanish )
means :
'crypto currencies : race to the moon' ( in english )
🌍🚀🌑

( i speak with chatgpt in spanish to improve my spanish, therefore... 🤓 )
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 16, 2025, 09:17 AM
so, as you may know, in 3d graphics, it is difficult to render big shapes or far away shapes and manage great distances.

for this game, a race from the earth to the moon,

the sun is 1,390,000 km in diameter ☀️
the earth is 12,740 km in diameter 🌍
the moon is 3,470 km in diameter 🌑

the sun is at 149,600,000 km from the earth
the moon is at 384,400 km from the earth

therefore i can't just use big spheres and put them at these distances...

so, i have thought about it, and i think that i could use a skybox which will be child of the player, and move with the player, and use maths to determine the sizes of the sun, the earth, the moon, on the skybox, depending on where the player is between the earth and the moon, and redraw the skybox when necessary...

i am discussing with chatgpt to figure out this... 🤓📝
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 16, 2025, 05:19 PM
Quote from: RemiD on Jun 16, 2025, 09:17 AMso, as you may know, in 3d graphics, it is difficult to render big shapes or far away shapes and manage great distances.

for this game, a race from the earth to the moon,

the sun is 1,300,000 km in diameter ☀️
the earth is 12,700 km in diameter 🌍
the moon is 3,400 km in diameter 🌑

the sun is at 149,000,000 km from the earth
the moon is at 384,000 km from the earth

therefore i can't just use big spheres and put them at these distances...

so, i have thought about it, and i think that i could use a skybox which will be child of the player, and move with the player, and use maths to determine the sizes of the sun, the earth, the moon, on the skybox, depending on where the player is between the earth and the moon, and redraw the skybox when necessary...

i am discussing with chatgpt to figure out this... 🤓📝

I think the Human eye can only see about 35miles away. So anything past that wouldn't need to be rendered ::)
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 16, 2025, 08:12 PM
Quote from: Baggey on Jun 16, 2025, 05:19 PMI think the Human eye can only see about 35miles away. So anything past that wouldn't need to be rendered

you don't see the sun or the moon with your eyes ? 🤔
i can see them...


my post was more about that big shapes and big distances cause all kinds of problems in 3d graphics (for rendering or for calculations)

therefore we use a 'skybox' to represent far away shapes.

but i need a way to adjust the size of the earth and the size of the moon (on the texture of the skybox) depending on where the rockeship is  (between the earth and the moon).
the size of the sun will stay approximately the same.

chatgpt helped me to find the math formulas, this should work. 📝🤓
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 17, 2025, 01:32 PM
What i meant is you can not see detail.

Yeah you see the shape it's color. But red over a distance isn't clearly visible because of it's longer wavelength.

So for the sun at 33.5 miles away a yellow blob would suffice?

But space is in a vacuum?
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 17, 2025, 11:13 PM
QuoteWhat i meant is you can not see detail.
sure.


and what i meant is that big shapes and big distances often cause problems in 3d graphics.
i guess it is because of the precision of calculations to update / to render when shapes are really big or are really far away from the origin (0x,0y,0z)...

therefore we use a skybox, or spheres (at the appropriate sizes) attached to a skybox.
this way, no need to have big shapes or to have entities at big distances.

i have done some experiments today.
at +1,000,000z the rendering is still correct
at +10,000,000z the entities 'shake' a little
at +100,000,000z the entities 'shake' a lot
at +384,400,000z, the entities 'shake' a lot or are not positionned correctly or disappear...

the good news is that i can use 384 zones of 1,000,000 width (x axis), 1,000,000 height (y axis), 1,000,000 depth (z axis), without problem, and always keep player and the camera and the relevant entities, near the origin (0x,0y,0z).
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 18, 2025, 08:51 AM
Cant wait to see some piccy's
Title: Re: rocketships racing 3d
Post by: Ricky on Jun 19, 2025, 02:30 AM
Quote from: RemiD on Jun 14, 2025, 09:37 AM(the text is in spanish because i talk in spanish with chatgpt...)
nice and coherent, i think, 🧐

  Hi Mate, you can chat with me in Spanish whenever you like. Chatting with an AI can feel empty, right?
  As a suggestion, I recommend you start thinking about a good tutorial about your game and how it relates to cryptocurrencies.
  Your idea seems very interesting. I want to see how you execute it. I think the true art of creating a video game is how you execute an idea. Good luck with it!
  R.-
Title: Re: rocketships racing 3d
Post by: Ricky on Jun 19, 2025, 02:44 AM
Quote from: RemiD on Jun 17, 2025, 11:13 PMtherefore we use a skybox, or spheres (at the appropriate sizes) attached to a skybox.
this way, no need to have big shapes or to have entities at big distances.

  ...or you can do like the geniuses at "Starfield" and replace the 3D entity with a nice 2D sprite who always looks at the camera. ;)
  R.-
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 19, 2025, 01:29 PM
Quote from: Ricky on Jun 19, 2025, 02:30 AMAs a suggestion, I recommend you start thinking about a good tutorial about your game and how it relates to cryptocurrencies.

my goal is to make a simple 3d racing game (with rocketships, from the earth, to the moon !)

and have gameplay elements (competitors, obstacles, friends, enemies, events, money (tokens), fuel, items (and associated powers) ) which help to understand the important concepts and factors which can influence the financial markets (especially the fiat currencies market and the crypto currencies market )

of course the vision i have about it will change during the development (as always).

we will see how it goes 👀
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 20, 2025, 08:23 AM
Quote from: Ricky on Jun 19, 2025, 02:44 AMor you can do like the geniuses at "Starfield" and replace the 3D entity with a nice 2D sprite who always looks at the camera.
sure, i can use only a textured skybox with 2d shapes, or i can use 3d spheres for the earth and for the moon, and a textured quad (=textured sprite) for the sun.

but this does not change the problem that i have to know the sizes of the sun, of the earth, of the moon, and their positions in the 'sky', depending on where the rocketship is between the earth and the moon (on the zaxis) and depending on its lateral offset (on the x axis and y axis).

fortunately there is chatgpt to help me to find the formulas to calculate this 📝🤓
Title: Re: rocketships racing 3d
Post by: Baggey on Jun 20, 2025, 09:17 AM
Wouldn't a simple pythagoras do the trick  ::)

https://www.google.com/search?q=pythagoras+theorem+formula&client=firefox-b-d&sca_esv=f189ccc98951b8a3&ei=VRhVaOSLKP-8hbIPu63eiQU&oq=pythagoras+theorem&gs_lp=Egxnd3Mtd2l6LXNlcnAiEnB5dGhhZ29yYXMgdGhlb3JlbSoCCAAyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyChAAGLADGNYEGEcyDRAuGIAEGLADGEMYigUyDRAAGIAEGLADGEMYigVIoDhQAFgAcAF4AZABAJgBAKABAKoBALgBAcgBAJgCAaACDZgDAIgGAZAGCpIHATGgBwCyBwC4BwDCBwMzLTHIBwo&sclient=gws-wiz-serp

Just solve for a which would be the dimension of the object. Once b is over a certain distance "switch/Case" graphic for simple blob? or different images?

Hope that gives you an idea to simplify the model abit?

Baggey
Title: Re: rocketships racing 3d
Post by: Krischan on Jun 20, 2025, 09:41 AM
Quote from: RemiD on Jun 17, 2025, 11:13 PMthe good news is that i can use 384 zones of 1,000,000 width (x axis), 1,000,000 height (y axis), 1,000,000 depth (z axis), without problem, and always keep player and the camera and the relevant entities, near the origin (0x,0y,0z).

It must also not be physical accurate because as we know from Hitchhiker's Guide to the galaxy:

"Space is big. Really big. You just won't believe how vastly hugely mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist, but that's just peanuts to space"

For a game it is sufficient if it is "believable big" but even here you'll run into technical limitations soon. I've made a lot of experiments and Tech Demos for a space game that I haven't shown yet because it was never finished. For the size problem I've always used two approaches in combination:

- use a simple 1.0/distance scaling factor
- keep the Camera in a small box

I wrote this function years ago for the latter problem:
Global localx:Float, localy:Float, localz:Float
Global globalx:Float, globaly:Float, globalz:Float
Global simx:Float, simy:Float, simz:Float


' keeps the player in a given distance While the world can Move far away
Function Home(target:TEntity, world:TEntity, homesize:Int = 100)

    ' store Local player Position
    Local localx:Float = EntityX(target)
    Local localy:Float = EntityY(target)
    Local localz:Float = EntityZ(target)

    ' Check X axis
    While localx > homesize
   
        globalx:+homesize
        localx:-homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, -homesize, 0, 0
       
    Wend

    While localx < - homesize
   
        globalx:-homesize
        localx:+homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, homesize, 0, 0

    Wend

    ' Check Y axis
    While localy > homesize

        globaly:+homesize
        localy:-homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, 0, -homesize, 0
       
    Wend

    While localy < - homesize

        globaly:-homesize
        localy:+homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, 0, homesize, 0
       
    Wend

    ' Check Z axis
    While localz > homesize
   
        globalz:+homesize
        localz:-homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, 0, 0, -homesize
       
    Wend

    While localz < - homesize
   
        globalz:-homesize
        localz:+homesize
        PositionEntity target, localx, localy, localz
        MoveEntity world, 0, 0, homesize
       
    Wend

    ' store simulated player Position
    simx = localx + globalx
    simy = localy + globaly
    simz = localz + globalz

End Function

I've uploaded a demo with the full source here:
Quattest_Homekeeping (https://www.extrasolar.de/blitzbasic/bmax/Quattest_Homekeeping.zip)

It is basically a huge boring starfield but it demonstrates how the camera "moves" through a really big starfield but never reaches the outer limits. This also avoids the common Z-Fight problems if your Camerarange extends 1,10000. And Objects that are further away than 10000 units can be often rendered as a pixel or small Sprite if they are not too big.
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 20, 2025, 09:47 AM
QuoteSpace is big. Really big. You just won't believe how vastly hugely mind-bogglingly big it is.
indeed

QuoteFor a game it is sufficient if it is "believable big" but even here you'll run into technical limitations soon.
yes

i have my ideas to manage this, which should work. i am not going to look at your code now because don't want to confuse my mind... maybe later...
Title: Re: rocketships racing 3d
Post by: Krischan on Jun 20, 2025, 09:49 AM
No need to hurry, as I wrote this code is 10+ years old ;) But keep us up to date with your ideas and solutions.
Title: Re: rocketships racing 3d
Post by: Ricky on Jun 20, 2025, 03:04 PM
Quote from: RemiD on Jun 20, 2025, 09:47 AMi have my ideas to manage this, which should work. i am not going to look at your code now because don't want to confuse my mind... maybe later...

  The closer you are to a paradigm, the harder it becomes to create new standards and ideas that aren't related to it.
  The baker on the corner who hasn't done it before is more likely to create an "original" video game than someone who has been doing the job for years... Which is truly strange and paradoxical.
  Conclusion: I recommend you hire the baker as an advisor :o .
  Maintain your inspiration.
  R.-
Title: Re: rocketships racing 3d
Post by: RemiD on Jun 25, 2025, 09:48 AM
some news :
my idea of having 384 zones of 1,000,000width (x axis) * 1,000,000height (y axis), * 1,000,000depth (z axis), which makes a 3d world of
1,000km (x axis) * 1,000km (y axis) * 384,000km (z axis), works well. 🙂

and the sizes and positions of the sun, of the earth, of the moon, change depending on where is the rocketship between the earth and the moon and depending on the offset of the rocketship on the x axis y axis, this works well also. 🙂


now i am working on the rocketship controls and physics / movements. 🌍🚀🌑
Title: Re: rocketships racing 3d
Post by: RemiD on Jul 01, 2025, 11:40 PM
Quote from: Krischan on Jun 20, 2025, 09:41 AMSpace is big. Really big. You just won't believe how vastly hugely mind-bogglingly big it is.

i see what you mean now. 😅

i have managed to achieve what i wanted, with 384 zones of 1,000,000m * 1,000,000m * 1,000,000m, and a skybox of only 1,000units * 1,000units * 1,000units, which moves with the spaceship, and the sun, the earth, the moon, sizes and positions are automatically adjusted in the skybox, depending on where is the spaceship between the earth and the moon (in which zone and at which position in the zone).

but i realized that for a racing game it is important to give the impression of fast movement, so it is pointless to be accurate with distances and sizes, but this was interesting to do.

so now i have reduced the size of each zone ( 100,000m * 100,000m * 100,000m ) and it looks / feels a little better. but i may reduce it even more...

http://rd-stuff.fr/blitz3d/rocketships-racing-3d-20250630.mp4

all these big distances, and big sizes, reminded me of this scene from a movie :
https://youtu.be/vP_OSWdIrXw?si=I3LjqX2F6zKHlgft