Engines NIFE Roadmap Shatterloop Game Projects
Deprecated Saepes Mundi Other Projects Blog

Game Projects

Stocks

Posted February 13, 2023 by Xhin



There are 3 Replies


Basic Stuff

A bit different.

  • Gameplay progresses on a real-time system that changes every 30 minutes. This is a game that you "check on" rather than play actively, though you can sorta do that too.

  • Your money and investments / bookmarks are stored server-side so playing this as an occasional phone game is more viable.

  • The gameplay revolves around analyzing value graphs and buying / selling shares in stuff.

  • The stock value is basically a "Fractal Time Graph" wherein slopes are appended in sections fractally, with the local values being more random within some set range. The actual subdivisions/sloping vary by company so if you can tell from the procgen data what the stock is going to do, you can take advantage of it. This algorithm apparently isn't easy to figure out -- my current thinking is that everything happens within some fixed range of value, and rather than a slope, a chunk represents an ending point -- this then creates a slope depending on the ending point of the last chunk, and then it fractally varies in smaller ranges relative to that slope. (Or in general? Idk, idk how much trig I want to do exactly or what any of this would look like).

  • Given how the engine works, the number of stocks is potentially infinite, but it makes sense to kinda limit it to 3-character ones or a smaller list that the system can scan and aggregate top performers for you. Or whatever feels most freeing.

  • Values are represented by zoomable graphs. Could use the same Google graphs api if the overhead on zoomable graphs isn't terrible.

    Long-term data randomly picks start date based on some handcrafted values and the stock seed, the way forever garden picks a board founded year.

  • Literally all you're doing is buying and selling stocks. You start with some fixed amount of money and make more money via profits. If you do something stupid you can reset the simulation and restart with the starting amount.

  • February 18, 2023
    Xhin
    Sky's the limit

    Algorithm

    This shouldn't be that hard to figure out.

  • Have set Landmark points where the value is something definite. The engine looks for the closest one of this kind (every week?)

  • The first layer varies stuff, averaging to the slope between two Landmark points with some range outside of it. Finding the slope at a particular point isn't particularly hard, just a bit of trig. The deviation from it is probably company-specific though there's probably variations in each chunk.

  • Each subsequent layer does something similar, with wild range bucking probably being pretty uncommon.

    For a prototype, maybe something like:

  • Layer 0 -- 30 minute windows, 8 of these (4 hours)

  • Layer 1 -- 4 hour windows, 6 of these. (1 day)

  • Layer 2 -- day windows, 7 of these (1 week)

  • Layer 3 -- week windows, 8 of these (2 months)

  • Layer 4 (optional) -- 2 month windows, 6 of these (1 year).

    Obviously this wouldn't correspond exactly to a year or 2 months or whatever but I should be able to create timestamps pretty easily and can just form-fit the algorithm accordingly.

  • October 13, 2023
    Xhin
    Sky's the limit

    Basis

    To prevent cheating, the actual procgen should happen server-side though I'll probably figure the algorithms out client-side. Client side might be okay long term if the stakes are low.

    October 13, 2023
    Xhin
    Sky's the limit

    Reply to: Stocks

    Username
    Password