EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
Forays Into The Unknown (EJ Builds A New Game Economy (Still))
Post new topic Reply to topic Goto page 1, 2, 3 ... 12, 13, 14  Next
View previous topic :: View next topic
Author Message
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
modified
PostPosted: Sat, 5. May 12, 12:06    Post subject: Forays Into The Unknown (EJ Builds A New Game Economy (Still)) Reply with quote Print

What with Atheism seeminly working in its current state I've been attempting a SonOfGod working on business methods as a primary integration of my "All stations have an account" etc. idea.
Well, I can say it's been interesting in the least.

In order to test the functionality of basic scripts already existing, I created a loop which checks a solar power plant for the number of ships it owns buying crystals, and if it has less than 3 it spawns one and sets it to do the standard (not the player) buy for best price crystals command.

This worked fine, until all the ships stopped doing anything at the same time.
I also noted, most interestingly, than when the ship dies (I killed the 3 stopped ones using a script) my loop didn't get enough time to create a new one... because it automatically did! It ordered a Mercury and a Mercury Hauler XL from Argon Prime's shipyard, and a Dolphin in Kingdom End to replace the 3 freighters! Part of me is amazed and happy, whereas the other part of me is confused and annoyed; I'm going to have to change or stop this behaviour if I want to control what it buys, where, and when.

I'd also like any insight into what 3 of the ships would just stop instantly, still running return to homebase according to Additional Information, and still all destinationed to home. But at 0m/s...


EDIT:


The Story So Far
What's done, or planned, is listed here.

All standard factories belong to a company.
All these companies are randomly created at the beginning of the game.
All the factories are at the start of the game assigned to one of these companies.
The companies expand to fill holes in the economy, grow when there's surplus to be used.
The companies hire ships for their stations, both for trade and defence.
All of this, and all trade, comes straight out of the companies account.
If the account goes negative the company is forced to start selling off its assets.
The company might be taken over by another rich company.
The ships and stations might be upgraded over time, either with new equipment or better ships, or in the case of stations an upgrade from M to L for example.
All freetraders and docktraders have an account too. They are now customised to only find trades they know they can afford.
They too spend their money on upgrades and better ships.
All of these upgrades and weapons, for example, have to be bought with real money from an equipment dock.
A central business news system is provided (for a fee...) for the entrepeneurs who wish to be up to date with the news.
An attempt at not using AP commands, to make it compatible with TC. (Will require a few specific changes such as not-not messing with the war sectors)


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.


Last edited by EmperorJon on Sun, 20. Jan 13, 01:30; edited 8 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 14:18    Post subject: Reply with quote Print

Ok, I have a set out plan now for how it all works.
Code:

Event Plugin
   |
   V
Loops Through Companies
   |
   V
Checks All Factories For The Company
   |
   V
Checks Ships, Resources, Etc. For Factory
   |
   V
Pools Data And Makes Decisions On A Factory And Company Level
   |
   V
Loop To Next Company


So it would see a company with say 10 food fabs, it would analyse each one, pool info, and make changes at possibly 3 levels:
Ship
Station
Company

Eg. Interrupt/Wait for trade job to finish then buy more engine tunings/new software.
Eg. Not enough energy, but local area has plenty, buy another import ship.
Eg. All our stations are running low on bio for the food, build a bio fab.

Then move on to the next company once all that's done.
The result would be dynamic growing companies with their own fleets.
The bit I'm least confident with is getting ships to buy/sell for best price like they would for a human player (minus the actual transactions), interrupting scripts to say "Stop, go to the equipment dock, buy more shields, carry on" and stopping the AI getting a bit too excited in various situations, re. self-replacing ships and similar, that I'd rather have control over.


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Lord Dakier



MEDALMEDAL

Joined: 08 Dec 2006
Posts: 2607 on topic
Location: VSF Flagship "Noblesse Oblige"
Thank you for registering your game
PostPosted: Sat, 5. May 12, 14:47    Post subject: Reply with quote Print

I like the testing for this but how dynamic can this economy be I mean we still need the player to make money. So we need a world where resources are constantly changing, one day worth of gameplay we may be low on e-cells whereas the next ion disruptors. I like the idea as we may see the more expensive products become more demanding which is really how it should be.


_________________
Dakier Vassarr;
High-Lord Admiral of Vassarr Space Force (VSF)
Funded by Alegron Trading Centre (ATC)
Lorae Mining Corp (LMC)
Powergen Resource Providers (PRP)
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Litcube





Joined: 20 Oct 2006
Posts: 2244 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 5. May 12, 14:50    Post subject: Reply with quote Print

I think what you might be experiencing is GOD automatically respawning homebase ships. I think. It'll do that.


_________________
My works
Fixed Notoriety Rewards | Missile Rebalance & UI Icons | Phanon Corporation | Revelation | Saturn Complex Hub
Back to top
View user's profile Send private message
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:17    Post subject: Reply with quote Print

@Litcube Yeah, is there any way to stop it? Wink


In other news (Razz), I got bored of doing things I couldn't do so I made the company name randomiser. I'm getting Goner companies called "Green Peace" and "Red Light". Although putting a racial modifier phrase in for pirates "Totally Legitimate" was so worth it. "Clan's Totally Legitimate Foodstuffs" was one of the companies... Razz

EDIT:

Code:
Black Tempest
Weaver's Tempest Shadow Power
Ocracoke's Storm Weaver
Senator's Badlands Weaver
Ocracoke's Storm Weaver Bio
Crimson Yaki's
Crimson Weaver Weapons
Earth Terra Technologies
Gold United Power
Blue Democratic Power
Green Terra
Red Sol Shielding
Kuiper Belt United
Crimson United Shielding
Red Commander's Shielding
Crimson Force Mining
Black Blockade Bio
null Commander's Consumables
Green Front Mineral
null Force
Yellow Front
Crimson Elysium Shielding
Crimson Hope
Yellow Peace
Blue Truth's Mineral
Harmony of Perpetuity Elysium Energy
Elysium of Light Light
Harmony of Perpetuity Light Shielding
Lost Order Acquisitions Technologies
Mi Ton's Refuge Acquisitions
Bala Gi's Joy Totally Legitimate
Silver Acquisitions
Split Fire Acquisitions Foods
Bala Gi's Joy Flag Power
Nopileos' Memorial Clan's Foods
Profit Center Alpha Profit Energy
Scale Plate Green Company
Yellow Company
Blue Investment
Silver Profit Farming
Ceo's Sprite Profit Consumables
Red Company
Pontifex' Seclusion Xaar's Weapons
Green Dimensional Energy
Blue Dimensional Weapons
Black Dimensional
Gold Holy
Priest Rings Trinity Energy
Yellow Trinity
Family Pride Family Foods
Family Njy Clan
Yellow Clan Power
Red Clan Power
Black Clan
Black Clan
White Patriarch's Bio
Green Sea
Green Queen's Technical
Red Sea
Red Water Bio
Yellow Sea Defence
Yellow Royal
Reservoir of Tranquillity Sea Energy
Legend's Home Federation's
Yellow Alliance
Guiding Star Federation's Mineral
Gold Federation's Bio
Yellow Federal Technologies
Midnight Star Alliance Mining
Red Venture


There should be an even number of each type and race there, but I'm not sure. It was developing too many that sounded similar, but then I had a stroke of genius to put sector names in some of them.


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Litcube





Joined: 20 Oct 2006
Posts: 2244 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:25    Post subject: Reply with quote Print

EmperorJon wrote:
@Litcube Yeah, is there any way to stop it? Wink



Yeah, you can connect every ship to a SECTOR_CHANGE signal script and destroy it *IF* it has a few conditions:

Job ID 0
Has a local variable you assinged, etc...


Remember to have a run script launch from the signal script, or you won't be able to debug. Signal scripts are cached.

So:

Signal sector change -> EJ.Sig.SectorChange would have one line, which is to run: EJ.Sig.SectorChange.Run.

The run script should have all your code.


_________________
My works
Fixed Notoriety Rewards | Missile Rebalance & UI Icons | Phanon Corporation | Revelation | Saturn Complex Hub
Back to top
View user's profile Send private message
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:29    Post subject: Reply with quote Print

What, so the only way to stop it is to manually kill off all spawners?


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jack08





Joined: 25 Dec 2005
Posts: 2234 on topic
Location: Australia
Thank you for registering your game
modified
PostPosted: Sat, 5. May 12, 15:35    Post subject: Reply with quote Print

EmperorJon wrote:
What, so the only way to stop it is to manually kill off all spawners?


Or don't use home base, personally i used a local variable to signify home base instead - gave up fighting with the god engine on this one... rofl

Code:


* [THIS]->set homebase to $HomeBase
* [THIS]->add secondary signal: signal={SIGNAL_KILLED}, script='xtl.lib.signal.clearhomebase', prio=0, name='xtl.lib.clearhomebase.die'
* [THIS]->add secondary signal: signal={SIGNAL_CAPTURED}, script='xtl.lib.signal.clearhomebase', prio=0, name='xtl.lib.clearhomebase.bail'
[THIS]->set local variable: name='xtl.homebase' value=$HomeBase
 
return null


Note the commented out attempts at defeating the god engine with signals... lol Very Happy


_________________


Last edited by Jack08 on Sat, 5. May 12, 15:39; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:39    Post subject: Reply with quote Print

Heh, I was using home base for the entire purpose of there being the nice vanilla owned ships interface... real shame. I'll see what I can do though...


Also, now I'm getting names like

Code:
Combined Water
Ore Belt Venture
Subsidised Federal Farming
Albion Gamma Federal Shielding
Established Federal Farming
Red Venture Bio
Black Corporate Technologies
Free Trade Alliance Shielding


at least for Argon companies... well, the top one's Boron. But some of the other race ones sound really dumb.

Code:
The Moon Earth's
Elysium of Light Light Energy
Official Fire Power
Family Pride Clan
Family Pride Clan
Family Pride Clan
(all in a row on 1 run through)
LooManckStrat's Legacy Skull Foods
Menelaus' Oasis Water


Are some of my favourite... less official sounding... ones.


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Litcube





Joined: 20 Oct 2006
Posts: 2244 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:54    Post subject: Reply with quote Print

"Totally Legitimate Foodstuffs" hahah. That's awesome.


If you still want to see a homebase, you can use my method. I am currently using it to stop all xenon spawn with my Revelation mod. And to stop all god create blockade ships. I have exceptions for laser towers, nav beacons, jump beacons, etc.

If you don't need to "see" the homebase, and just need the logic side of it, use Jack's method.


_________________
My works
Fixed Notoriety Rewards | Missile Rebalance & UI Icons | Phanon Corporation | Revelation | Saturn Complex Hub
Back to top
View user's profile Send private message
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 15:58    Post subject: Reply with quote Print

Well I also need to be able to quickly get a list of all ships which are homebased to a station...

It's just, deleting all the ships which spawn only for them to spawn again gets messy... especially considering it'll be for EVERY station in the universe.

EDIT: Also trying to use the "arrays in arrays"... I'm aware of the 2D array concept, well... ND arrays. I understand them and have used them in other things, therefore I have a suspicion that I'm either misunderstanding the MSCI forum's explanation or there's a mistake (Would anyone else that sub array 3 element 4 should be yellow, not element 5?). Anyway... I tried putting a value into array[0][0] and taking it out of array[0][0] and I get null of course... Evil or Very Mad


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Litcube





Joined: 20 Oct 2006
Posts: 2244 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 5. May 12, 16:18    Post subject: Reply with quote Print

No. Once you remove the homebase for the ship in the run script and then destroy it, it will not respawn.

Re: arrays, you need help in understanding 3 dimensional arrays?


_________________
My works
Fixed Notoriety Rewards | Missile Rebalance & UI Icons | Phanon Corporation | Revelation | Saturn Complex Hub
Back to top
View user's profile Send private message
Jack08





Joined: 25 Dec 2005
Posts: 2234 on topic
Location: Australia
Thank you for registering your game
PostPosted: Sat, 5. May 12, 16:18    Post subject: Reply with quote Print

expanding on my solution, you could use somthing like this:

xtl.lib.sethomebase
Arguments:
Refobj([THIS]): of the ship who is getting the homebase assignment
$HomeBase: The target ship or station to attach as homebase
Code:

[THIS]->add secondary signal: signal={SIGNAL_KILLED}, script='xtl.lib.sig.clearhomebase', prio=0, name='xtl.lib.clearhomebase.die'
[THIS]->add secondary signal: signal={SIGNAL_CAPTURED}, script='xtl.lib.sig.clearhomebase', prio=0, name='xtl.lib.clearhomebase.bail'
[THIS]->set local variable: name='xtl.homebase' value=$HomeBase
$OwnedObjects = $HomeBase->get local variable: name='xtl.owned.objects'
if not $OwnedObjects
  $OwnedObjects = array alloc: size = 0
  $HomeBase->set local variable: name='xtl.owned.objects' value=$OwnedObjects
end
append [THIS] to array $OwnedObjects


xtl.lib.sig.clearhomebase
Code:

$HomeBase = [THIS]->get local variable: name='xtl.homebase'
$OwnedObjects = $HomeBase->get local variable: name='xtl.owned.objects'
$Idx = get index of [THIS] in array $OwnedObjects offset=-1 + 1
if $Idx != -1
  remove element from array $OwnedObjects at index $Idx
end


This will add the ship to a local array "OwnedObjects", and will also remove it from the local array "OwnedObjects" when it dies or bails.


_________________
Back to top
View user's profile Send private message Visit poster's website
Lord Dakier



MEDALMEDAL

Joined: 08 Dec 2006
Posts: 2607 on topic
Location: VSF Flagship "Noblesse Oblige"
Thank you for registering your game
PostPosted: Sat, 5. May 12, 16:23    Post subject: Reply with quote Print

[quote="EmperorJonThere should be an even number of each type and race there, but I'm not sure. It was developing too many that sounded similar, but then I had a stroke of genius to put sector names in some of them.[/quote]

Just to pull you power rangers away from the hard work of modding. Why not just get the community to come up with names like what was done with the early stock exchange mod. Be pretty cool if they all messaged you a list of like 10 for several races.


_________________
Dakier Vassarr;
High-Lord Admiral of Vassarr Space Force (VSF)
Funded by Alegron Trading Centre (ATC)
Lorae Mining Corp (LMC)
Powergen Resource Providers (PRP)
Back to top
View user's profile Send private message Send e-mail MSN Messenger
EmperorJon



MEDALMEDAL

Joined: 29 Dec 2008
Posts: 6665 on topic
Location: Leicester
Thank you for registering your game
PostPosted: Sat, 5. May 12, 16:24    Post subject: Reply with quote Print

I'll keep all this in mind...

@Litcube

I understand multidimensional arrays, but Mark's description seems to A. only describe how to put things in and out, not actually define them, and B. be slightly wrong, what I said when I linked to it.


_________________
_______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3 ... 12, 13, 14  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sun, 19. May 13, 13:57

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.31017 seconds, sql queries = 75