Jump to content

(M)MO/RPG


Silier
 Share

Recommended Posts

  

On 8/27/2020 at 12:07 AM, myou5e said:

I was trying to get the code working more smoothly without errors and up to date with the Dev code, but because there have been so many changes I thought it would be a lot easier to work out which bits I need from your code, and just copy that code into the latest Dev version(most of the code is in the separate components), as opposed to trying to fix about 2000 lines(the number that shows up when I attempt to do a diff between your UnitAI and the newest Dev UnitAI). These are the changes I made to UnitAI, it executes without errors, but when testing it seems like it does nothing at all. Do you know what I might be missing?


583,589d582
<         "Order.Pick": function(msg) {
<                 if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer))
<                         this.SetNextState("INDIVIDUAL.PICK.PICKING");
<                 else
<                         this.SetNextState("INDIVIDUAL.PICK.APPROACHING");
<         },
< 
2245,2277d2237
<                 "PICK": {
<                         "APPROACHING": {
<                                 "enter": function() {
<                                         if (!this.MoveTo(this.order.data, IID_ResourceGatherer)) {
<                                                 this.SetNextState("INDIVIDUAL.IDLE");
<                                                 return true;
<                                         }
<                                         return false;
<                                 },
<                                 "MovementUpdate": function(msg) {
<                                         if (msg.likelyFailure)
<                                                 this.SetNextState("INDIVIDUAL.IDLE");
<                                         else if (this.CheckRange(this.order.data, IID_ResourceGatherer))
<                                                 this.SetNextState("PICKING");
<                                 },
<                                 "leave": function() {
<                                         this.StopMoving();
<                                 }
<                         },
<                         "PICKING": {
<                                 "enter": function() {
<                                         const cmpInventory = Engine.QueryInterface(this.entity, IID_Inventory);
<                                         if (!cmpInventory) {
<                                                 this.FinishOrder();
<                                                 return true;
<                                         }
<                                         cmpInventory.Add(this.order.data.target);
<                                         this.FinishOrder();
<                                         return true;
<                                 }
<                         }
<                 },
< 
3866,3878d3825
< UnitAI.prototype.Pick = function(target)
< {
< 	this.PerformPick(target);
< }
< 
< UnitAI.prototype.PerformPick = function(target)
< {
< 	const order = {
< 		"target": target,
< 		"force": true,
< 	};
< 	this.AddOrder("Pick", order, false);
< }

PS. I tried out your new MMO map. Good work! Seems like most of the functionality is already there! It has so much potential.

 

 

 

Link to comment
Share on other sites

 

16 hours ago, myou5e said:

I downloaded your latest commit to Github, overwrote your UnitAI with the latest Github Dev UnitAI(Should be the same as SVN), and added just a few lines to UnitAI and it seems to have the same functionality. Haven't thouroughly tested though. This is good news. It actually changes a lot about how I was going to make my own mod. I was planning on creating separate entities for everything, because I didn't properly understand the variant system(:LOL:) .

Some improvements I could suggest to make it more usable.

  • I COULD NOT find the bow on the map, even with revealed vision and even looking at the location in the map file(and estimating its position relative to the other entities). I think probably it might be that the  equipment seems to have a very small footprint. Perhaps increase the footprint size and maybe highlight pickable items? I don't know how easy it would be to outline equipment without the cursor over it. I ended up finding it by putting a box of apples over top of the bow, which is visible.
  • Another issue is that the items are half embedded in the ground.
  • For my mod, I want to integrate with the generic RTS play and I want units to be able to equip and purchase items at scale, treating them possibly as resources, and equip them at a blacksmith. I guess it should be quite easy to do this, but I'm not exactly sure the best way to go about it. I want to walk a bunch of troops near a blacksmith, and then get an option to upgrade their armor across the whole group. At that point, all the stats and variant changes are applied to them just as it does when you  "pick up" an item.
  • You treat the mmo player as special, instead of modifying template_unit, you create template_unit_mmo. Maybe this was intented to be a temporary thing, i'm not sure. However, for my mod I want the inventory to apply to all units. A man is not a "spearman", just a man who also happens to be holding a spear. This would be a good idea, I think, even for an MMO only game, as it would be simple to make the killed units droup their equipment for the player to pick up. Would you modifiy the SpawnEntityOnDeath code to make this work? Perhaps, in a multiplayer game, this could create too many entities and then lag, but this could be counteracted by only sometimes dropping the gear, and having a limited lifespan after it is dropped.
  • Also, atlas wont start with your mod enabled.

ERROR: Failed to load map maps/scenarios/_default.pmp: File_OpenFailed
terminate called after throwing an instance of 'PSERROR_Game_World_MapLoadFailed'
  what():  Failed to load map.
Check application log for details.
Aborted
  • The main problem with integration seems to be the panels right now. This error comes up when I select a Spartan citizen. I understand "spart_house" is there because it is the first item in the list of construction options.

GAME STARTED, ALL INIT COMPLETE
ERROR: RelaxNGValidator: Validation error: structures/spart_house:1: Expecting an element BatchTimeModifier, got nothing
ERROR: RelaxNGValidator: Validation error: structures/spart_house:1: Invalid sequence in interleave
ERROR: RelaxNGValidator: Validation error: structures/spart_house:1: Element ProductionQueue failed to validate content
ERROR: RelaxNGValidator: Validation failed for '(null)'
ERROR: Failed to validate entity template 'structures/spart_house'
ERROR: JavaScript error: gui/session/session.js line 223
Error: deepfreeze requires exactly one object as an argument.
  GetTemplateData@gui/session/session.js:223:1
  g_SelectionPanels.Construction.setupButton@gui/session/selection_panels.js:299:18
  setupUnitPanel@gui/session/unit_commands.js:97:8
  updateUnitCommands@gui/session/unit_commands.js:149:4
  updateSelectionDetails@gui/session/selection_details.js:499:2
  updateGUIObjects@gui/session/session.js:671:2
  onTick@gui/session/session.js:599:3
  __eventhandler54 (Tick)@session Tick:0:1
ERROR: Errors executing script event "Tick"
ERROR: JavaScript error: gui/session/session.js line 223
Error: deepfreeze requires exactly one object as an argument.
  GetTemplateData@gui/session/session.js:223:1
  g_SelectionPanels.Construction.setupButton@gui/session/selection_panels.js:299:18
  setupUnitPanel@gui/session/unit_commands.js:97:8
  updateUnitCommands@gui/session/unit_commands.js:149:4
  updateSelectionDetails@gui/session/selection_details.js:499:2
  updateGUIObjects@gui/session/session.js:671:2
  onSimulationUpdate@gui/session/session.js:642:2
  __eventhandler56 (SimulationUpdate)@session SimulationUpdate:0:1

 

 

 

  • Like 1
Link to comment
Share on other sites

@myou5e

16 hours ago, myou5e said:

I COULD NOT find the bow on the map, even with revealed vision and even looking at the location in the map file(and estimating its position relative to the other entities). I think probably it might be that the  equipment seems to have a very small footprint. Perhaps increase the footprint size and maybe highlight pickable items? I don't know how easy it would be to outline equipment without the cursor over it. I ended up finding it by putting a box of apples over top of the bow, which is visible.

I was thinking about particles, but that would be no help for people playing without particles. Maybe some mark hovering above item could help. 

16 hours ago, myou5e said:

Another issue is that the items are half embedded in the ground.

I know, currently I use the same actor for equiped item and item on the ground. I plan to make another one for items on the ground. I just make functionality first then art :)

16 hours ago, myou5e said:

Also, atlas wont start with your mod enabled.

Fixed.

16 hours ago, myou5e said:

You treat the mmo player as special, instead of modifying template_unit, you create template_unit_mmo. Maybe this was intented to be a temporary thing, i'm not sure. However, for my mod I want the inventory to apply to all units. A man is not a "spearman", just a man who also happens to be holding a spear. This would be a good idea, I think, even for an MMO only game, as it would be simple to make the killed units droup their equipment for the player to pick up. Would you modifiy the SpawnEntityOnDeath code to make this work? Perhaps, in a multiplayer game, this could create too many entities and then lag, but this could be counteracted by only sometimes dropping the gear, and having a limited lifespan after it is dropped.

I rather create custom templates when I end up overwriting everything. It is easier than to keep all svn templates in check.
Entities with inventory drops their equipment already. I am planning to implement loot that will drop from other entities.

16 hours ago, myou5e said:

The main problem with integration seems to be the panels right now. This error comes up when I select a Spartan citizen. I understand "spart_house" is there because it is the first item in the list of construction options.

I had not updated svn version. Fixed.

  • Like 1
Link to comment
Share on other sites

47 minutes ago, Angen said:

@myou5e

I was thinking about particles, but that would be no help for people playing without particles. Maybe some mark hovering above item could help. 

I know, currently I use the same actor for equiped item and item on the ground. I plan to make another one for items on the ground. I just make functionality first then art :)

Fixed.

I rather create custom templates when I end up overwriting everything. It is easier than to keep all svn templates in check.
Entities with inventory drops their equipment already. I am planning to implement loot that will drop from other entities.

I had not updated svn version. Fixed.

The issue isn't about integrating with the latest svn code. The issue is that the UnitAI and other components that overwrite the other files have drifted apart. I think  this is why I get errors such as not being able to collect resources when I play with your mod enabled on a standard map.

Edited by myou5e
Link to comment
Share on other sites

1 minute ago, Angen said:

Yes, I removed selectable component from resources and I believe ability to be gathered from too.

Ok. Well presently nothing works for me because I DON'T have the latest SVN. I will probably not continue to test this until the next snap release because compiling is too hard to do on this machine. For now I think I'll work on seasons. Perhaps the resource fix was easier than I thought. I copied over the pieces of code that give the mmo functionality from your components to the latest component files, and it seemed to work with your mmo map, but not the resources, so maybe all i had to do is change your resource template :-p

Do you know when the Snap packages get updated?

Link to comment
Share on other sites

I copied over the public folder to my snap folder and it seemed to work, i'm working with the latest javascript but not the latest compiled code. My tests wont necessarily be accurate.

Removing these two worked(there was no template_gaia_fauna) for resource collection:

template_gaia_flora.xml
template_gaia_geo.xml

Building is not functional. I still get the same error in the selection buildings. I would think it's easier to copy over the pieces you know are needed to the newest version of the javascript components rather than continue to patch things up?

On the MMO_test map  I don't lose any hitpoints. But this is most likely to do with the new Resistance patch and I dont have the most recent compiled code.

Link to comment
Share on other sites

@Angen

The Test mission, where you need to "capture" the ship to complete the mission, kind of reminds me of the stories of Charon. Maybe we could base the storyline along Greek Mythology. Perhaps we could require the player to pickup a coin from one of the fallen persians he has just slaughtered. Maybe our hero gets to the ferry, and presumptuosly hops in the boat without looking at Charon, Charon asks him for his payment, and our hero, sardonically chuckles and flips him a coin from one of the Persians.

The mission after this could be in Hades, perhaps, or maybe the river journey.

I think this would be a great setting for the MMO as it has the mythological focus of traditional MMOs but roughly the same setting as 0ad.


https://folklorethursday.com/myths/a-coin-for-the-ferryman-charon-and-the-journey-to-hades/

 

 

Screenshot_2020-08-29_23-15-45.png

Edited by myou5e
Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...