How to fake floating point?

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Basically, the Advanced Long Range scanner here has issues displaying things at fractions of angles (say, 81.3 degrees). Is there any way to feed a number into Trans so that it does display at decimal angles?
Is there another way?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Jeoshua
Militia Lieutenant
Militia Lieutenant
Posts: 163
Joined: Sat Sep 06, 2008 3:48 pm

There is no way to do anything with floating points.

However, fixed point is a possibility. Start by multiplying the data you wish to deal with by some number, maybe 100, maybe 1000, maybe 10,000. Then, do math in this higher resolution. When you wish to display or use that data, you can get the modulo of the data in some other more usable value, and then keep the remainder stored for the next turn.

I used a technique like this in the code for the Singularity Proof of Concept. Look at the code for it (although, it's really out of date and likely doesn't work on the current version).
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

You're Alive!!!!!! (go to IRC sometime will you?)
Sweet, didn't think of the higher resolution.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Star Weaver
Militia Commander
Militia Commander
Posts: 311
Joined: Sun Nov 07, 2010 10:20 pm
Location: . . . between the stars and the warm black sky . . .

Arbitrary point should be possible with decimal strings, but the processing would be slow as hell. Also, trying to make this work might have been part of what drove me away from modding the first time ...
Image
Image
Image
Post Reply