Make default respawn methods not hardcoded.
|Target version:||Version 0.10.0|
Presently there are at least two methods that hard code the default respawn point based on a continent or race enum.
A good portion of this could be eliminated and driven by data if we added a DefaultRepawnPoint to continent.dfn. Another portion of this code evaluates the race of the individual character. Since there is no explicit 'race' sheet but the statement only takes into consideration the primary four races we could add a DefaultRespawnPoint to the race_stats.dfn.
Note! If this change is made it will need to be coordinated with Winch Gate so that their sheets can be appropriately updated.
#1 Updated by drealz over 1 year ago
I could try working on this if you want, you basically want it so you can edit a simple txt or cfg file to change it with out going into the source and looking for it and changing it all the time? I am also curious why you would want to do this unless its so that when you make a new map or so you can easily change it, any way is cool and would like to work on it but may take some time as I am still pretty new at this source code and still exploring the amazing stuff it has, so if any one else can do it faster step right up =].
#2 Updated by sfb over 1 year ago
Upon further inspection it appears that the CCharacter::setPositionToDefaultRespawnPoint method isn't called anywhere at all. Looking at how it works reinforces that it cannot possibly be in use.
One of the problems that we have in Ryzom Core right now is that there is a small bit of code that is hard-coded to continent names - and those continent names are those of the Ryzom game. There appears to be very little justification for hard coding it. Take the CCharacterRespawnPoints::addDefaultRespawnPoint method for example. It is basically one huge switch statement that qualifies each continent by an enum and then specifies a default respawn point for that continent.This means if you add a new continent and want a default respawn point - which is required since the default for default respawn points is "newbie_start_point" - you need to follow this process:
- Create the continent (land, exports, sheet, etc)
- Create the region primitive for the continent, specify a 'place' for respawn.
- Edit the continent source file to add your new continent to the enum.
- Edit the starting point source file to add your new starting point
- Edit the character respawn source file to add the default respawn.
I should be able to eliminate steps 3-5 if continents are not hard coded - creating the name.continent sheet (basically an XML file) and creating the region primitive should be sufficient. Currently it is not.
The problem lies in the fact that these continent IDs (determined by the continent and start point enums) are actually stored in player persistent data. The correct ID should have been the CSheetId for the continent. Changing this involves either making the system bi-directionally compatible (e.g. leaving it to work as is for the hard coded continents but allows dynamic provisioning of new continents) or a method must be created to dynamically fix up persistent data.
Hope this helps!
#3 Updated by drealz over 1 year ago
I also have some other questions since I've never played ryzom, how does the respawn work is it like if you travel to a far area in the continent and you die you go back to the beginning spawn point, or are there multiple spawn points in cities or so to say? I would like a detailed discription of how the respawns work would be nice and thanks for your help.
#4 Updated by sfb over 1 year ago
You can specify multiple 'teleport_spawn_zone' primitives within the region primitive and these may be available to players depending on certain criteria. What the code in question does is force a spawn zone for your respawn if you, the player, have not explicitly chosen one. Otherwise spawn zones are referred to by their name.
Some teleport_spawn_zones are not selectable by players and are used by NPCs or mission trees to teleport you to a location. Some merchants can sell you teleport tickets whose destination is a teleport_spawn_zone.