Page 1 of 1

My own space trading game

Posted: Wed Aug 10, 2022 8:16 am
by Tdarcos
I'd like some help with a game I'm trying to develop. I'm trying to compute something that I know I don't jave the math. But first, some background:

I am trying to do something similar, create a space trading game with planets in different places, where different planets have different prices for things, but having the planets locations generated programmatically rather than randomly. I actually had written a program to do this, based on a game someone wrote, which had a subroutine that, given the x,y position it would be empty space, a planet with technology level from 1-9, or a wormhole (randomly moves you somewhere else), and maybe a couple other things. I lost the original sources in my many moves.

The program offered many kinds of cargo that you can buy or sell, which included
Fuel - your ship uses one unit of fuel per turn, and fuel cannot be sold.
Torpedoes - use on other ships or sell at other planets.
Melange - I borrowed this one from Dune.
Beef, pork, wheat, corn, potatoes, whiskey, electronics, steel ingots, iron ore, drugs, copper, silver, gold, platinum, potassium, tools, and, of course, $2 whores (I was absolutely shameless).

You start with a certain amount of cash, in which you buy whatever you can afford, with level 1 technology planets being cheap for raw materials (ore, foodstuffs) but expensive for technology. Level 9 planets are the reverse, with 2-8 being in between, i.e. low planets provide resources, high planets process them. This means you can do quire well carrying goods from one planet to another, There are other things. Oh, and the game is multiplayer, so you can spend time doing planet-to-planet trading, or go look for another ship, try to overcome their shields and armor, then loot them for fun and profit! You can destroy the husk of a ship that is defeated and drained, in which case they start over, or leave them with a damaged worthless hulk stripped and discarded, if you're devious.

The game play is on a grid from 8000 to FFFF, then 0000, then 0001 to 7FFF, in both X and Y directions. This means the grid could be up to 65536x65536, or 4 billion, but typically is smaller than this. Anyone spot can be empty space, a planet, an anomaly, or another ship. Ships have certain size hulls, of which larger ones may be purchased. Bigger hulls hold more cargo.

My question is, does anyone have the math to know how to plot planet locations, and tech levels for those planets, for any specific location?

Re: My own space trading game

Posted: Wed Aug 10, 2022 8:21 am
by pinback
planet.x = math.random(65536)
planet.y = math.random(65536)
planet.techlevel = math.random(9)

Although I feel like I'm not understanding the question.

Re: My own space trading game

Posted: Fri Jan 20, 2023 2:02 pm
by raecoffey
Are we talking about eigenvalues?

Re: My own space trading game

Posted: Fri Jan 20, 2023 2:55 pm
by pinback
We'll never know!

Re: My own space trading game

Posted: Fri Jan 20, 2023 6:47 pm
by raecoffey
Eigenvalues represent magnitude or, better yet, importance. Bigger Eigenvalues correlate with greater important directions. I found an example of how to use eigenvalues in the real world 🌎. I'll paste it maybe them it'll make sense of what I'm getting at. Did you take linear algebra or differential equations?

Re: My own space trading game

Posted: Fri Jan 20, 2023 6:49 pm
by raecoffey
Eigenvalue analysis is commonly used by oil firms to explore land for oil. Because oil, dirt, and other substances all produce linear systems with varying eigenvalues, eigenvalue analysis can help pinpoint where oil reserves lie.

Re: My own space trading game

Posted: Fri Jan 20, 2023 7:21 pm
by raecoffey
You could reverse engineer it. Program the matrix to find the eigenvalues and put the planets along the eigenvectors maybe? I dunno.

Re: My own space trading game

Posted: Fri Jan 20, 2023 9:14 pm
by raecoffey
I don't know if you can automate the search for eigenvalues, I'm just assuming that you can, I always had to do it by hand.

Re: My own space trading game

Posted: Sat Jan 21, 2023 8:14 pm
by raecoffey
I'm sorry if I sounded condescending about eigenstuff, I'm just used to non-math degree people knowing anything in my abstract little world. I'm sorry, my bad.

Re: My own space trading game

Posted: Sat Jan 21, 2023 9:14 pm
by Ice Cream Jonsey
raecoffey wrote: Sat Jan 21, 2023 8:14 pm I'm sorry if I sounded condescending about eigenstuff, I'm just used to non-math degree people knowing anything in my abstract little world. I'm sorry, my bad.
I am sure the Commander will be here any second now to reply to your post with his take.

Just kidding! It is impossible to get him to reply to the posts you want him to. It can't be done!!!

Re: My own space trading game

Posted: Sun Jan 22, 2023 1:26 am
by Jizaboz
TDarcos holds the Flava Flav clock of replies.

Re: My own space trading game

Posted: Mon Jan 23, 2023 10:10 pm
by Tdarcos
pinback wrote: Wed Aug 10, 2022 8:21 am planet.x = math.random(65536) ...Although I feel like I'm not understanding the question.
You are misunderstanding it a litrle. I wabt the game to be programmatically generated in a repeatable fashion. So that if the PLANET function is passed 4356,72 it will always returb the same value,, so that any time rhe routine is xalled it always gets the sane result.
raecoffey wrote: Fri Jan 20, 2023 6:47 pm Eigenvalues represent magnitude or, better yet, importance.
Given that explanation, yes, the planet levels are eigwnvalues. Different planet levels indicate technology levels. Alao, what they sell on a planet is related to its value, e.g. a level 6 hull, produced on a level 6 planet, is 6 times as large as a level 1 hull, meaning it can carry 6 times as much cargo; a levwl 4 engine is 4 times as efficient, etc.. But some things are commodity items, ship's fuel, torpedoes, most cargoes are the same from planet to planet, except, some cargies - like food - are cheaper at a level 1 planet, more expensive on level 9. Torpedoes are cheaper on higher level planets and more expenaive on low level planets.That makes trae possible.

Re: My own space trading game

Posted: Mon Jan 23, 2023 10:12 pm
by Tdarcos
Ice Cream Jonsey wrote: Sat Jan 21, 2023 9:14 pm [
I am sure the Commander will be here any second now to reply to your post with his take.
Jonsey, I never got any notification anyone had responded.

Re: My own space trading game

Posted: Tue Jan 24, 2023 2:20 am
by Jizaboz
Tdarcos wrote: Mon Jan 23, 2023 10:12 pm
Ice Cream Jonsey wrote: Sat Jan 21, 2023 9:14 pm [
I am sure the Commander will be here any second now to reply to your post with his take.
Jonsey, I never got any notification anyone had responded.
I'm still awaiting your thoughts on Flava Flav.

Re: My own space trading game

Posted: Tue Jan 24, 2023 3:40 pm
by Tdarcos
Jizaboz wrote: Tue Jan 24, 2023 2:20 am I'm still awaiting your thoughts on Flava Flav.
I think the guy is weird. Anyone who would wear an analog wristwatch with a dial 2 feet wide, as a necklace, probably needs to face getting his clock cleaned, if you get my drift. It would allow us to know what makes him tick. He should know the times have changed. But a guy like him who wears one of those probably wants a second.

I'll admit I've run out of time - based puns.

Re: My own space trading game

Posted: Tue Jan 24, 2023 5:09 pm
by Ice Cream Jonsey
Tdarcos wrote: Mon Jan 23, 2023 10:12 pm
Ice Cream Jonsey wrote: Sat Jan 21, 2023 9:14 pm [
I am sure the Commander will be here any second now to reply to your post with his take.
Jonsey, I never got any notification anyone had responded.
Notifications are broken?

Re: My own space trading game

Posted: Tue Jan 24, 2023 9:10 pm
by Jizaboz
Bout damn time!

Re: My own space trading game

Posted: Tue Jan 24, 2023 9:17 pm
by raecoffey
Tdarcos wrote: Tue Jan 24, 2023 3:40 pm
Jizaboz wrote: Tue Jan 24, 2023 2:20 am I'm still awaiting your thoughts on Flava Flav.
I think the guy is weird. Anyone who would wear an analog wristwatch with a dial 2 feet wide, as a necklace, probably needs to face getting his clock cleaned, if you get my drift. It would allow us to know what makes him tick. He should know the times have changed. But a guy like him who wears one of those probably wants a second.

I'll admit I've run out of time - based puns.
Ha ha ha...

Re: My own space trading game

Posted: Thu Jan 26, 2023 11:35 am
by bryanb
All this talk about eigenvalues has made me realize that we could use a fun math facts thread around here. It's the one thing Jolt Country has always been missing!

Re: My own space trading game

Posted: Thu Jan 26, 2023 7:03 pm
by raecoffey
bryanb wrote: Thu Jan 26, 2023 11:35 am All this talk about eigenvalues has made me realize that we could use a fun math facts thread around here. It's the one thing Jolt Country has always been missing!
Yessss!