I'm currently working on a video series comparing gamemaker/construct 3/unity across a variety of challenges - from speed of workflow, to engine specific challenges. Currently I'm working on SOLID comparisons. I've worked ALOT with construct in the past, but I've never found a good way to deal with the following types of scenarios. It is the primary reason I hate working with construct and is the one thing holding it back in my mind.
Here are 2 simple scenario that are very easy to program in a conventional language but are a nightmare in construct events. Performance can also take a huge hit depending on how you implement it. I'm curious to know how others have structured projects to deal with these problems but also retain maintainability and allow for easy additions.
OKAY, here we go:
Garages hold buses. A bus can pick up people, people have pockets, those pockets can hold anything but for now we care about wallets and keys. The keys unlock gates, the wallets hold money, coupons, access cards, and credit cards. We need to be able to add and remove people to the bus, items to people's pockets, items to people's wallets, etc. When a bus arrives at a gate it needs to know if any of the people onboard have a key to the gate. At any moment, we need to know the total money on board the bus. The bus has to pay tolls, but each type of bus determines how to take money from people on the bus. People can trade items(including money) while on the bus. Some bills are fake.
The complexity arises when we begin to add more functionality to items. Perhaps people now carry gems, and the bus is gem powered and each type of gem on board affects the performance of the bus. Blue gyms allow the bus to travel on water, green gyms save gas, etc... Perhaps garages behavior is modified by buses and their contents as well. Perhaps people now have stats and they are happier based on how much money they carry (fake or not- unless they are bankers and then no amount of money satisfies them)
What if after all that I want some people to carry bombs, and some people to carry guns, and some people to have driving skills...
There is clean, SOLID ways to code this. But using events... eek.
Scenario two:
Characters have stats. They can carry gear. Gear can affect stats while being carried. Gear can be assigned to active slots and add functionality to the character. Not all characters have all stats and only have the stats they need. Gear can add additional stat categories. Attacks can modify, buff, or otherwise change stats. Field of effects can alter stats while in the effect but are removed once leaving the field.
Stats can be modified by addition, % change, etc... but those also should be ordered (for example a shield could double base defense, not modified defense, while a defense charm could double total defense including all gear etc...). In addition, some effects may only take place if certain gear is present. For example, fluff armor may add the stat "flammability" to a character. A fireball spell may add the effect "burn" to the character. During update, the burn effect compounds based on flammability. Other effects may not change stats, but simply cause the player to smoke, flash, jitter, etc...Some effects may remove other effectors (water removes all effectors caused by fire damage...)
Effects are unlimited and a character could have 100s of active buffs, mods, etc.
This type of dynamic buff system combined with inventory is a complex problem, but with constructs current limitations, you will quickly drown in complex workarounds to avoid c3 limitations in functions and custom actions.
Any useful paradigms for this within the constraints of c3?