How to handle this... more delicately

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
I made a roller coaster game in C# a while back. and surprisingly the back-end doesn't have many issues. Yet I still want to re-explore it, in the name of improving ability to code.

Issue:

When a User Builds a track and the user brakes one of the rules... like go out of bounds (x,y), go into the ground (go to low), build tracks into another track, the game attempts to fix the issue and move on. Instead of give them in error sound or message, saying no go. your going out of bounds.

This is extremely important. As I found in war3 modding, and on the phone that if they cant mash buttons and it build a coaster people lose interest really fast. Avg Age is likey 8-16 years old.

So I am able to fix one rule with no problems and its fairly isolated. But the issue is being resolved and another issue comes up at the same time....

like your building out of bounds, but it backs up and turns left to get you in bounds and you run into a track.. or you run into the ground because you happened to be pointed at a down ward angle.

Then Issue A, And Resolution A, get mixed in with Issue B, And Resolution B. This doesn't always cause melt downs but it can.

I don't mind. Removing tracks from the user to get them back on track.

So... image (2) is what it really is. and capture.png is me in a attempt to streamline it (flow chart program) but realizing i have no idea how i would do it. (A,B,C,D are modules that would attempt to fix the issue)
 

Attachments

  • Capture.PNG
    Capture.PNG
    216.6 KB · Views: 430
  • image (2).png
    image (2).png
    346 KB · Views: 452

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Attempt:

Builder Has 3 Options, Build, Remove, Finish Coaster. All 3 are considered a Task.

Task is a string being sent into Task Manger. (I says single task to make it clear, unlike before only one Task Can be attempted at a time).

In Task Manger, It will attempt the task, And if the task Fails, And it is Any of the users requested functions, it will have failed due to a "Rule" being broken.

Then Fail, Will find what caused it to fail, and Change the task with what caused it to fail.
(For example you try to build stright 3 tracks, it finds you go out bounds, so now instead of building any tracks, it takes your request tosses it out, and attempts to get you in bounds, even though you haven't gone out of bound yet. This is a preventive measure as you were attempting to go out of bounds).

So Now It changes your Task to a "Fix Task" that will attempt all methods it knows to get a Pass. So Task Manger may run Test Task many times for a single Fix Task, as it may have many different ways to attempt to fix it. for example if you were going out of bounds it would try going left, and if that fails going right. Also For All Fix Tasks there is threshold of how many times it can back up your tracks.

If all of those fail. it will go to the fail circle, and then remove the task, (It possible it would give the user in error sound or MSG here)

If the Task Pass, or the Fix Task passes, it will then build the tracks for real. and Check if your now in the finish area. If you are, It will call the finish coaster, that will then start that task.

If your coaster is in the finish area, It will finish. If the user pressed the finish coaster button it will attempt to get to the finish area and finish, but can fail.



The Real question is... how much worse or better will this be for the user then my old system.

My old system. would look for issues every track built, and if found attempt to fix it. and then if inside of that, another issue found try to fix it. The issue was many of the fixs requied backing up of tracks. making it much more complex. When I built this i kept that in mind, so i did alot of complex logic to make it able to address 2-3 problems all at the same time fixing each other while finshing the users request. But Its a huge mess. and takes me hours to understand what hte crap is going on when i need to go back in and add anything to the Builder, and although isnt causing crashs or real issues as it has fail safes... seems like a bad idea.


If I make the change, and then I find that its HARDER to build a coaster. I will be fairly upset, even if its the much nicer code. and likely 2-4 factors less.


HMMMMM.....

added another version (2) this one has all the functions... I think. besides The UI, and on load fuction..
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I would go with the less error prone method that is easier to maintain.
What you said there sounds pretty reasonable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top