My own space trading game

Let's make some video games!

Moderator: Ice Cream Jonsey

Post Reply
User avatar
Tdarcos
Posts: 9329
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

My own space trading game

Post 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?
Evil cannot create anything new
They can only corrupt and ruin
What good forces have invented or made.
- J.R.R. Tolkien

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: My own space trading game

Post 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.
I don't have to say anything. I'm a doctor, too.

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post by raecoffey »

Are we talking about eigenvalues?
Lorelie Kraus the 1st

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: My own space trading game

Post by pinback »

We'll never know!
I don't have to say anything. I'm a doctor, too.

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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?
Lorelie Kraus the 1st

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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.
Lorelie Kraus the 1st

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post by raecoffey »

You could reverse engineer it. Program the matrix to find the eigenvalues and put the planets along the eigenvectors maybe? I dunno.
Lorelie Kraus the 1st

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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.
Lorelie Kraus the 1st

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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.
Lorelie Kraus the 1st

User avatar
Ice Cream Jonsey
Posts: 28842
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: My own space trading game

Post 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!!!
the dark and gritty...Ice Cream Jonsey!

User avatar
Jizaboz
Posts: 4788
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: My own space trading game

Post by Jizaboz »

TDarcos holds the Flava Flav clock of replies.
(╯°□°)╯︵ ┻━┻

User avatar
Tdarcos
Posts: 9329
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: My own space trading game

Post 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.
Evil cannot create anything new
They can only corrupt and ruin
What good forces have invented or made.
- J.R.R. Tolkien

User avatar
Tdarcos
Posts: 9329
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: My own space trading game

Post 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.
Evil cannot create anything new
They can only corrupt and ruin
What good forces have invented or made.
- J.R.R. Tolkien

User avatar
Jizaboz
Posts: 4788
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: My own space trading game

Post 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.
(╯°□°)╯︵ ┻━┻

User avatar
Tdarcos
Posts: 9329
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: My own space trading game

Post 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.
Evil cannot create anything new
They can only corrupt and ruin
What good forces have invented or made.
- J.R.R. Tolkien

User avatar
Ice Cream Jonsey
Posts: 28842
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: My own space trading game

Post 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?
the dark and gritty...Ice Cream Jonsey!

User avatar
Jizaboz
Posts: 4788
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: My own space trading game

Post by Jizaboz »

Bout damn time!
(╯°□°)╯︵ ┻━┻

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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...
Lorelie Kraus the 1st

User avatar
bryanb
Posts: 807
Joined: Sat Apr 06, 2019 2:56 pm

Re: My own space trading game

Post 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!

User avatar
raecoffey
Posts: 316
Joined: Fri Jan 06, 2023 11:37 pm
Location: Crotchfester NY
Contact:

Re: My own space trading game

Post 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!
Lorelie Kraus the 1st

Post Reply