Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race improvements #3123

Open
cryham opened this issue Feb 9, 2024 · 8 comments
Open

Race improvements #3123

cryham opened this issue Feb 9, 2024 · 8 comments

Comments

@cryham
Copy link
Contributor

cryham commented Feb 9, 2024

A few things that I'd like to improve:

  1. Bigger font for race time, guessing impossible in ImGui, so maybe other way.
    I see MyGui is used for Hud right? Probably best there. Ogre overlay and fontdef likely not.
  • Where and how is best time saved (on disk) for races on maps?
    Edit: in /cache/raceTimes.asdata
  1. Best time per vehicle. Right now it's just 1 best time for track, obviously fastest vehicles will win and won't see best times after when driving something slower. Maybe even adding a Gui list to show all best times driven for vehicles.

  2. Allow fixing vehicle during race without abort or add option for it. Too many times I didn't finish after hit.

  3. Damage mode off. IDK if possible?
    I would prefer to race without vehicle damage, or at least no driving damage to wheels. Or a less damage mode.

  4. Reversed direction race. IDK maybe even enough to determine is to check sign(dot(vehicle heading vector, start box) or so on start. Obviously own best time(s) for reversed.

Possible already: 6. Somehow visualize on minimap (surveymap) where are different races, and their checkpoints. Or start places even in 3D?
Took me a while to notice all of them on Auriga, even f1_testtrack, just from tiny 3d meshes at start places.

  1. Next checkpoint beam.
    A clearly visible, 3D, tall, transparent (green) beam in center of next checkpoint.
    Great also for tracks with no gates or checkpoint meshes.
    Is in Trigger Rally and then got into Stunt Rally too, I think it's good for RoR also.

Do you have any comments, dislike any ideas, are you okay to merge if I added this (IDK if I will manage and when) and any hints in code for implementation?

@cryham
Copy link
Contributor Author

cryham commented Feb 10, 2024

Okay 3. was easy by commenting out in resources/scripts/races.as:

			//this.cancelCurrentRace();
			//this.message("You must not reset the vehicle during a race! Race aborted.", "stop.png");

@ohlidalp
Copy link
Member

ohlidalp commented Feb 12, 2024

I have my own plans with the race system - see #3018. Since I wrote that code I changed my approach-instead of wrapping a 'missions.as' script around the races script, I'll extend the races script directly as it's already pretty extensible with custom events and callbacks. The plan to implement a datasheet and ability to load the races and hoc remains.

As for your points here I like the gameplay suggestions. Some things are more of a difficulty setting matter than permanent change matter but I like the direction.

For race/mission editing, we need a visual terrain editor first because all is based around eventboxes which are part of terrain. The 'races.as' as it is wants data entered directly in script but that effectively blocks it from being editable in editor. And people have severe issues editing script at all, making them rely on
https://docs.rigsofrods.org/terrain-creation/race-generator/. I want to use the mission datasheet for this.

For the UI part, your best bet are OGRE overlays combined with AngelScript bindings in branch #3030. I'm intensively working on that one, not on the overlays in particular but other OGRE bindings - scene graph, entities and Manual object.

MyGUI isn't really welcome in this project, it's a constant source of build and porting issues and I hate it's API, see #1333 for my rants. Our current HUD systém depends on it but I see the future in Overlays for HUD, imgui for UI and AngelScript for both.

Race times are stored via LocalStorageClass API which reads and writes .ini files. Docs: https://developer.rigsofrods.org/d1/d7f/class_script2_game_1_1_local_storage_class.html

Heh, sorry for dumping all this on you, I've been a solo dev for years and I'm kind of "in the middle of something" with every part of the game. If I may ask, consider contributing a doxy doc page on the race system. There is raw APIdoc https://developer.rigsofrods.org/da/d2a/group___script2_script.html but a more friendly intro page would help.

@cryham
Copy link
Contributor Author

cryham commented Feb 12, 2024

Okay, thanks. I didn't know there are started improvements.
And I'll focus on ImGui not MyGui.
But does this interfere with my ideas? I'm not sure, I think these could be small things to do maybe (e.g. 7, 2, 5, 3, 1). IDK if I manage to implement any just curious.
I think I'll first finish (or do as much as possible) my SR3 Track Editor track export to RoR, as started in that topic.

@ohlidalp
Copy link
Member

ohlidalp commented Feb 14, 2024

Hi, no it doesn't interfere, I'm just pointing you to existing docs and research for inspiration and friendly warning about things I intend to do.

For sure, I'd like you to implement those extensions alongside existing config: https://github.com/RigsOfRods/rigs-of-rods/blob/master/resources%2Fscripts%2Fraces.as#L134-L145

I'd also like to have a definition file format for the races. I already implemented one for the mission system but as I wrote above, I changed my mind, so I'm going to ( in coming days) create PR updating the race.as with the ability of loading race config from file. I'll pretty much reuse this code: https://github.com/ohlidalp/rigs-of-rods/blob/missionzip/resources%2Fscripts%2Fmissions.as#L34-L83 except I'll set race attrs directly instead of going via the Mission object. The code for checkpoints already uses the races-format: https://github.com/ohlidalp/rigs-of-rods/blob/missionzip/resources%2Fscripts%2Fmissions.as#L110-L151

PS I'm also definitely going to update races.as to use script events SE_EVENTBOX* instead of the legacy callback func passed to spawnObject(), please read the intro of #3081

@CuriousMike56
Copy link
Collaborator

* Where and how is best time saved (on disk) for races on maps?

Race times are stored in /cache/raceTimes.asdata.

4. Damage mode off. IDK if possible?
   I would prefer to race without vehicle damage, or at least no driving damage to wheels. Or a less damage mode.

Technically possible if a script could override the deform and break values of all set_beam_defaults. May introduce instability with some vehicles though.

6. Somehow visualize on minimap (surveymap) where are different races, and their checkpoints. Or start places even in 3D?
   Took me a while to notice all of them on Auriga, even f1_testtrack, just from tiny 3d meshes at start places.

Minimap already displays races and active race checkpoints:
RoR_2024-02-20_14-41-40
RoR_2024-02-20_14-42-06

@cryham
Copy link
Contributor Author

cryham commented Feb 20, 2024

Wow. How come I don't have it? Is it very new? I got 2024.02-dev build.
1106

@CuriousMike56
Copy link
Collaborator

Uncheck "Declutter overview map" in settings -> graphics. Perhaps that setting needs to be renamed..?

@cryham
Copy link
Contributor Author

cryham commented Feb 21, 2024

Ah thanks, that did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants