My own space trading game
Moderator: Ice Cream Jonsey
- Tdarcos
- Posts: 9529
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
My own space trading game
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?
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?
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
- pinback
- Posts: 17848
- Joined: Sat Apr 27, 2002 3:00 pm
- Contact:
Re: My own space trading game
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.
planet.y = math.random(65536)
planet.techlevel = math.random(9)
Although I feel like I'm not understanding the question.
Am I a hero? I really can't say. But, yes.
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
- pinback
- Posts: 17848
- Joined: Sat Apr 27, 2002 3:00 pm
- Contact:
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
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
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
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
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
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
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
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
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
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
- Ice Cream Jonsey
- Posts: 30065
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Re: My own space trading game
I am sure the Commander will be here any second now to reply to your post with his take.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.
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!
- Jizaboz
- Posts: 5420
- Joined: Tue Jan 31, 2012 2:00 pm
- Location: USA
- Contact:
- Tdarcos
- Posts: 9529
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: My own space trading game
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.pinback wrote: Wed Aug 10, 2022 8:21 am planet.x = math.random(65536) ...Although I feel like I'm not understanding the question.
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.raecoffey wrote: Fri Jan 20, 2023 6:47 pm Eigenvalues represent magnitude or, better yet, importance.
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
- Tdarcos
- Posts: 9529
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: My own space trading game
Jonsey, I never got any notification anyone had responded.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.
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
- Jizaboz
- Posts: 5420
- Joined: Tue Jan 31, 2012 2:00 pm
- Location: USA
- Contact:
Re: My own space trading game
I'm still awaiting your thoughts on Flava Flav.Tdarcos wrote: Mon Jan 23, 2023 10:12 pmJonsey, I never got any notification anyone had responded.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.
(╯°□°)╯︵ ┻━┻
- Tdarcos
- Posts: 9529
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: My own space trading game
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.
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
- Ice Cream Jonsey
- Posts: 30065
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Re: My own space trading game
Notifications are broken?Tdarcos wrote: Mon Jan 23, 2023 10:12 pmJonsey, I never got any notification anyone had responded.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.
the dark and gritty...Ice Cream Jonsey!
- Jizaboz
- Posts: 5420
- Joined: Tue Jan 31, 2012 2:00 pm
- Location: USA
- Contact:
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
Ha ha ha...Tdarcos wrote: Tue Jan 24, 2023 3:40 pmI 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.
Lorelie Kraus the 1st
- bryanb
- Posts: 815
- Joined: Sat Apr 06, 2019 2:56 pm
Re: My own space trading game
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!
- raecoffey
- Posts: 316
- Joined: Fri Jan 06, 2023 11:37 pm
- Location: Crotchfester NY
- Contact:
Re: My own space trading game
Yessss!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!
Lorelie Kraus the 1st