Now I was thinking maybe I'd code a market

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

I will probably introduce a function in economy which can take care of all the timing and threading details.
Great news , i am planning that too , as you have understood .

To close ( from my side :lol: ) the chapter about CargoContainer , i just need to show you
that my logic isn't strange , and is well described even in your plan.md :
https://github.com/nido/vegastrike-mark ... c/plan2.md
Cargo

The principal unit we are working with is Cargo. Cargo has a type (for example, Iron Ore. Iron ore has a fixed volume and mass and category per unit; but different amounts of units may be owned by different entities. The player may have a pile of Hull Patches in his cargo bay, the fighter barracks may have a very small pile of Hull Patches and there may be a even bigger stack of it back at the factory where the player for it from. Each of these piles is a single Cargo.

Before the economy is integrated into vegastrike itself, it needs to be able to work with the player just sitting back, so forget any player involvement from this point on.

CargoHold

CargoHolds are 'containers' of multiple types of cargo. One example would be the cargo hold on the player ship, another the cargo available for trade at a base. Factories could have their own pools of cargo separate from the base trader. Cargo can be added to and deleted from a CargoHold as well as a Cargo Hold. Removing cargo by any of these methods will only work if all cargo can be removed. On success, that function returns true, on failure, it will return false.
To have this CargoHold class would have been a better design than the actual Cargo .
But it is just my humble opinion .
Your implemention is actually ( following your plan):
Cargo is a CargoHold and cargoType a cargo .

Thank you for the details of ProductionOption , that are used finally just to setup
the factories .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
nido
Merchant
Merchant
Posts: 43
Joined: Tue Sep 03, 2013 2:35 pm

Re: Now I was thinking maybe I'd code a market

Post by nido »

ezee wrote:To close ( from my side :lol: ) the chapter about CargoContainer , i just need to show you
that my logic isn't strange , and is well described even in your plan.md :
https://github.com/nido/vegastrike-mark ... c/plan2.md
Cargo[snip]
for the sakje of clearity I will refer to plan.md Cargo as oldCargo, plan.md's CargoHold as oldCargoHold, in-code Cargo as newCargo, in-code CargoType as newCargoType and vegastrikes semidefinition of Cargo as "Cargo".

Yes, this information is slightly out of date still (i'll look at it this weekend). The oldCargo as described here is more or less "Cargo" as implemented in Vegastrike itself. A oldCargo also consists of the type of cargo it is and an amount of that type of cargo, whereas the oldCargoHold can accomodate multiple of those. It becomes problematic when you try to work with it though.

For example: "1 iron" is different (not equal) then "2 iron", yet, if you add "1 iron" to a oldCargoHold with "2 iron", you would like to end up with "3 iron", and not with "2 iron and 1 iron".

To do so, you must break up every single one of the oldCargo's in the CargoHold into a newCargoType (or at least something conceptually the same) and a counter, where you can compare the new oldCargo's newCargoType with the newCargoType of the object you are currently checking for "equality". Afterwards, you need to either increment or decrement the number of the oldCargo, or replace it with one with a higher count.

And what does an object of "2 iron" mean and how would you compare it to "1 iron". Given one needs to be able to combine these, it makes sense to indeed compare the "iron" parts of "1 iron" and "2 iron", and combine them if they are "equal". This "iron" thing is actually the thing that makes sense to model, as "iron" is equal to "iron" in a useful way.
CargoHold
Similarly, can one not have a cargo consisting of "1 foo and 2 bar"? What is so special about a number of a single type of stuff that warrants being isolated in its own little class away from other things?
CargoHold started as CargoHold because I invisioned it to be the physical bay in which stuff gets stored. However, when the oldCargo got turned into the newCargoType because of above, oldCargo became more or less equivalent to a std::pair of a newCargoType and a number, and oldCargoHold was a vector of those. Combining the two into one structure (a std::map of Cargos and numbers) an object of "n foo's" did not make much sense, and newCargo has no limits as one expects from a CargoHold.
To have this CargoHold class would have been a better design than the actual Cargo .
But it is just my humble opinion .
And I have been trying to explain why it isn't the case for about two pages of forum. That does not mean I'm right, but it does mean that I don't understand why a "cargotype+amount" type would be better. Please elaborate why it is better and I may agree with you.
Your implemention is actually ( following your plan):
Cargo is a CargoHold and cargoType a cargo .
More or less, though I assume given all the text i typed here and in previous posts you gasp there are essential differences between oldCargo and newCargoType.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

woaw ...
Sorry but my english is too poor to be able to follow your explications .
Too many terms that confuse me also .
I was simply trying to flat the mountain of understanding problems i had with your library .

As i said earlier , i finally admited that having the Class Cargo that holds a load instead of cargo would be enough to understand the role of the class .
And more intuitive to use .
Think about it as a gameplay , but applied to code .

Anyway , i must make efforts to understand technical descriptions in english , and perhaps
my expression is also not so good to be fully understood. May be in french i could better express my ideas without being boring or doing mistakes .

At last , your library is too complicated for me .
I've got nothing more to offer , as i posted a lot about every little thing i had in mind .
Thank you for your patience and your efforts to answer to my questions .
:arrow:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
nido
Merchant
Merchant
Posts: 43
Joined: Tue Sep 03, 2013 2:35 pm

Re: Now I was thinking maybe I'd code a market

Post by nido »

ezee wrote:woaw ...
Sorry but my english is too poor to be able to follow your explications .
Too many terms that confuse me also .
I was simply trying to flat the mountain of understanding problems i had with your library .
Last post, you seemed to be advocating changing the current implementation for reasons of "To have this CargoHold class would have been a better design than the actual Cargo." I cannot accept this without qualification, hence I asked for it.
As i said earlier , i finally admited that having the Class Cargo that holds a load instead of cargo would be enough to understand the role of the class .And more intuitive to use .
I do not understand.

std::map<CargoType, unsigned int> cargo is a private part of the datastructure. Library users cannot touch it. Also, how a thing is named has very little to do with what the design of a thing is. Feel free to think of that thing as a 'load'.
anyway , i must make efforts to understand technical descriptions in english , and perhaps my expression is also not so good to be fully understood. May be in french i could better express my ideas without being boring or doing mistakes .
Dommage! Malheureusement, je ne parle pas beaucoup Français.

Be as boring as you need to. I am more interested in your undestanding of this library then to read funny texts. For funny texts, I read My Little Pony.

The library is way, way simpler then the factory masterplan leads one to believe.

There exists the Economy. An Economy consists of Bases.
Bases exists out of a bunch of factories and a cargoStore (which is a "Cargo"). The Factories use the cargoStore to get input from and output to the same cargoStore. Factores can have multiple ProductionOptions, but only one of the ProductionOptions is active at a time.
"Cargo" consists of a map of CargoTypes and counts, indicating how much of a certain CargoType is in the Cargo.

Time is discretely modelled, at one moment the state is one way, "tick()" happens, and the universe is different. Eventually, you can tell the economy to run tick for, for example, once every five minutes. This eventuality is not implemented yet.


At last , your library is too complicated for me .
I've got nothing more to offer , as i posted a lot about every little thing i had in mind .
Thank you for your patience and your efforts to answer to my questions .
:arrow:[/quote]
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

Dommage! Malheureusement, je ne parle pas beaucoup Français.
Merci pour le geste , ton français est parfait .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

Hi .
I just started a Wiki page about the actual Vegastrike system , with links to functions
in c++ and python that could help you for your future integration .
Feel free to visit at : https://sourceforge.net/p/vegastrikevo/ ... r%20Games/

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
gonzo
Bounty Hunter
Bounty Hunter
Posts: 207
Joined: Wed Oct 20, 2010 3:50 pm
Location: Kungälv, Sweden
Contact:

Re: Now I was thinking maybe I'd code a market

Post by gonzo »

-Unload of the Vessel started
....................
-Ganja quantity delivered to moon : 11
-Cargo remaining in Vessel : 0
The price of potato chips on the moon just went up.
There are 10 types of people in this world, those who understand binary and those who don't.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

The price of potato chips on the moon just went up.
:lol:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Now I was thinking maybe I'd code a market

Post by loki1950 »

Don't forget the peanut butter cups either!

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Now I was thinking maybe I'd code a market

Post by ezee »

Don't forget the peanut butter cups either!
Good !
:wink:
And the bartender at Caribbean spaceport just said to me to don't forget 007's favorite
drink :
INGREDIENTS
3 measures of Gordon's Gin
1 measure of vodka
1/2 measure Kina Lillet
Lemon peel for garnish

Origin
The drink was invented and named by secret agent James Bond in the 1953 novel Casino Royale.

"A dry martini," [Bond] said. "One. In a deep champagne goblet."
"Oui, monsieur."
"Just a moment. Three measures of Gordon's, one of vodka, half a measure of Kina Lillet. Shake it very well until it's ice-cold, then add a large thin slice of lemon peel. Got it?"
"Certainly, monsieur." The barman seemed pleased with the idea.
"Gosh, that's certainly a drink," said Leiter.
Bond laughed. "When I'm...er...concentrating," he explained, "I never have more than one drink before dinner. But I do like that one to be large and very strong and very cold and very well-made. I hate small portions of anything, particularly when they taste bad. This drink's my own invention. I'm going to patent it when I can think of a good name."

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
gonzo
Bounty Hunter
Bounty Hunter
Posts: 207
Joined: Wed Oct 20, 2010 3:50 pm
Location: Kungälv, Sweden
Contact:

Re: Now I was thinking maybe I'd code a market

Post by gonzo »

:lol:

---

Q - How do I use the documents, dox stuff, in there?
/vegastrike-market/doc$ ls
doxygen_stl.cpp plan2.md scatchpad.txt unittest.template.hpp
gpl-2.0.txt reqeng.md unittest.template.cpp unittest.template.main.cpp
The /doc folder look the same before and after make. Am I supposed to build something here?
There are 10 types of people in this world, those who understand binary and those who don't.
nido
Merchant
Merchant
Posts: 43
Joined: Tue Sep 03, 2013 2:35 pm

Re: Now I was thinking maybe I'd code a market

Post by nido »

'make' doesn't do anything for the doc folder.

doxygen_stl.cpp - file included for teaching doxygen how STL classes work. Now deprecated since i found the BUILTIN_STL_SUPPORT switch
plan2.md - semicurrent design info about the classes in this library.
scatchpad.txt - some snipplets not related to the project proper but which were handy to remember during early development. currentyly contains only a git command to find commit hashes
gpl-2.0.txt - the licence text
reqeng.md - starting state of a requirements document. new requirements welcome
unittest.template.hpp - template used by 'mkunittestfiles.sh' to create skeleton test class bases on a file in the src directory.
unittest.template.cpp - template used by 'mkunittestfiles.sh'
unittest.template.main.cpp - template used by 'mkunittestfiles.sh'

with regards to the drink, (by design), market can only creates two drinks at the time, for it uses integers on the input. You could have two if you have a '1/2 measure Kina Lillet' cargo, though.


feel free to comment on what documentation you are missing.
Post Reply