Trade tycoon style game

RavianGamingIndustries
21 Nov 2016, 00:44

So I've worked about two hours on trying to get a combat system to work with no success so I'm ready to just pitch that idea and go with a more trade tycoon (buying here, selling there, maybe even buying your own shop (haven't quite figured out what the purpose of have your own shop would be)) style game but before I invest another 10 hours into making a game, i want to know if anyone would even be interested in playing a game like that. If so I have two very different settings in mind and I'm curious which one would be preferred, the first is a Space themed game, second is a Medieval.


hegemonkhan
21 Nov 2016, 01:01

(advanced) combat is one of the most extensive coding systems in existence... most RPG systems (combat, equipment, items, spells, abilities/perks, leveling/lvlup, stealth, dialogue/conversion/npcs, quest/mission/goals/journal/diary/notes, hint/help, world design and management, game mechanics / equations / formulas, etc etc etc) are such

such a game (economic/transactions/"builder's/strategic/farming" game), can definately be done and fun, but not much easier to do than combat (in other words, not easy at all).

you're jumping right into doing very hard games/coding-design aspects... of course you're going to hit a huge wall, unless you're already an expert coder and intimitely familar with quest's coding.

see if you can understand doing (successfully do/implement a working demo game of) basic buying/selling (transaction) aspect, displaying its prices/descriptions/actions/results to the person playing the game, as well as a menu, UI, or whatever design for the user to handle/do it, and etc etc etc, to judge on how easy or hard it'll be for you.

if you want some somewhat similar type of game examples, let me know. I know of a few not-well known but very interesting/neat ones...


study a lot of Pixie's and Jay's (jaynabonne's) code, as they're two of the best and main contributors (Jay's currently busy now in real life, so hasn't been posting recently for a while now). The other moderators (and there's some users too) are really good coders, but they're busy managing the site and/or working on developing the next version of quest, QuestKit, andor are busy with making their own games, and so don't post that often on help with coding/doing things for people's games.


RavianGamingIndustries
21 Nov 2016, 16:33

yes I would like to have the links to games like this, i am curious to see if a game such as the one i desire is possible, i've tinkered with the coding but haven't been able to figure out how to make one item cost "X" amount in one room and "Y" amount in another


TinFoilMkIV
21 Nov 2016, 18:28

Both themes sound fine to me, I would have to say it depends on what the defining features that set it apart from just basic trading to make money, whether the game would actually interest me or not.

As for making an item have a different value depending on room/area, there are a couple ways you could go about this. The first would be to give each item a base value and give the room a scaling factor then calculate the price off of the two combined. IE: bread - value 100, room - BakedGoodsScaling - 1.3, ActualCost - value*scaling = 130. In that example I would have also given each item a category so scaling could be set across a group of items instead of individually, though you could certainly go for individual item scales as well.

The other method I would consider would be to give each room a dictionary of prices (basically a list but you can name each item on the list, I'd use this so that you can name each value for the item it relates to). Then pull the prices from there, which would allow you to have very precise control over items in each area, and likely combine with a base value for each item so any unlisted would be their default value. The downside is this requires a bit more advanced knowledge as well as a lot more work inputting all the individual values.


RavianGamingIndustries
21 Nov 2016, 18:36

Thanks, just curious do you know what the coding for that would look like


TinFoilMkIV
21 Nov 2016, 21:02

I do, however much of the coding is spread out so it's not exactly something you can just copy and paste over to a room. I'll try to give an example though

//bread item setup
value = 100

//store setup
BakedGoodsScaling =1.3

//store description of items and whatnot
msg("there are several items for sale here:"
msg("bread costs: " + (bread.value * this.BakedGoodsScaling))

dictionary method
//store setup
Inventory = NewStringDictionary ()
dictionary add (Inventory, bread, 100)
dictionary add (Inventory, cheese, 80)
dictionary add (Inventory, etc, 150)

//store display
msg("there are several items for sale here:")
if (DictionaryContains (Inventory, bread){
msg("bread costs " + StringDictionaryItem (Inventory, bread))
}
if (DictionaryContains (Inventory, cheese){
msg("cheese costs " + StringDictionaryItem (Inventory, cheese))
}
if (DictionaryContains (Inventory, etc){
msg("etc costs " + StringDictionaryItem (Inventory, etc))
}
//etc...
//the 'if' statements prevent errors from non-existent dictionary entries

Ultimately if you go that routed I'd go all the way and build a function to automatically generate all the store items instead of manually scripting each item out.


RavianGamingIndustries
21 Nov 2016, 21:42

//bread item setup
value = 100

//store setup
BakedGoodsScaling =1.3

and where would i put this coding? and if i had multiple items with which i wanted to do this could i just copy this code and edit it for each item and then just put it in one item after the other? also is BakedGoodsScaling the scaling for a store (the room) or would i use it for items that i would classify as baked goods? Sorry for all the questions but i believe if i can get the coding how i want it i will be able to make the game i am envisioning


TinFoilMkIV
21 Nov 2016, 22:56

Hmm, seems I was mistaken about objects having startup scripts. Your options are either create a script attribute for each object and special room, name them the same thing and create a startup script for the game itself that runs all of them right at the start, otherwise you'd have to use the offline editor to directly modify the starting attributes of objects.

And yes the 'BakedGoodsScaling' would belong to the room that is the store, that way each store could have a different value but still use the same script to calculate the prices.

For what you're doing you're likely going to want the offline editor if possible. You can probably do everything you'll want in the online editor but it will make parts more difficult. The main example being the 'BakedGoodsScaling' not being usable to scale multiple items since you cannot create object types in the online editor.


RavianGamingIndustries
21 Nov 2016, 23:24

I'm using the offline editor (I downloaded it yesterday) and do i insert the scaling as a script code or somewhere in the code view itself?


TinFoilMkIV
22 Nov 2016, 00:39

In that case you add those in the attributes tab of the relevant rooms and objects. You'll have to create the attributes and then you can set their starting value.


RavianGamingIndustries
22 Nov 2016, 00:41

ok, but how would i make the scaling attributes?


TinFoilMkIV
22 Nov 2016, 01:00

I'm not sure what you mean? In my example it would just be a double type attribute and multiply it by the value. You could also do an integer and treat it as a percentage. The whole scaling thing is just using a second attribute to scale the base value by.


RavianGamingIndustries
22 Nov 2016, 01:14

ok thanks, you answered my question by saying that it's a double type attribute, im sorry i didn't word my question the best, im not good with words lol


hegemonkhan
22 Nov 2016, 02:41

there's also this Function for doing/getting a modifier/multiplier value:

http://docs.textadventures.co.uk/quest/functions/getrandomdouble.html


You can always make your own Function (returning a value) as well, for example:

<function name="modifier_function" parameters="value_parameter,modifier_parameter" type="double">
  return (value_parameter * modifier_parameter)
</function>

// scripting example:

game.example_value = 63.924
game.example_modifier = 0.7
game.new_value = modifier_function (game.example_value, game.example_modifier)

here's the Attribute/Data Types:

http://docs.textadventures.co.uk/quest/types/

Doubles = Floats = Floating Points = Decimal Numbers: etc, -0.7, 0.0, 1.0237453, etc