RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Courageous Random Encounter System

Courageous

Wanderer
Something I ran into while testing this out. In areas like Britain graveyard, alot of the time the monsters will spawn on *top* of the buildings.
Well. The code is in SpawnFinder.cs.

There was a great deal of back and forth about how the system should handle Z in spawning. Like, what to do if the player is in a building, or noth? I vaguely recall that it's supposed to try to spawn at equal Z to the player in question. If it's not doing that, something is probably wrong. The code is a bit tricky, but not intractible. It's all there, in one spot.

I'll look into it this weekend.

If you see anything obvious before that, PM me.

C//
 

Courageous

Wanderer
Updated to 1.3

Fixed a crash bug associated with cleanup sweeps of killed mobiles.

Random Encounters now includes a full distro.


C//
 

Gustin

Wanderer
I've been kind of busy with school the last couple days (weeks), and I was wondering if you ever got that Z spawning issue sorted out. Thanks in advance.

Also, I removed the old version, dropped in your new version (and the searches), and tried to compile. I got the following:

Code:
Errors:
 + Customs/RandomEncounters-1.3/SpawnFinder.cs:
    CS0029: Line 96: Cannot implicitly convert type 'void' to 'bool'
    CS0029: Line 153: Cannot implicitly convert type 'void' to 'bool'
 + Customs/RandomEncounters-1.3/Timers.cs:
    CS0122: Line 238: 'Server.Engines.XmlSpawner2.XmlAttach.Defrag(object)' is i
naccessible due to its protection level
 

Courageous

Wanderer
My apologies. I modified Searches itself, but forgot. I posted a newer version in the attachments.

As for the XmlSpawner issue, this is because you have XmlSpawner in whole. That's fine; for the new cleanup code, I had to use a method that was previously private. Make that method public in XmlSpawner, and all will be good.

A future release will probably eschew XmlSpawner, because I'm starting to put it to uses for which it was not intended. To do that, I basically have to reroll the XmlAttachment persistence system, so I'm currently taking it easy with that. Will be a release or two away. It will be a generalized high speed persistence system, when I get around to it.

The Z spawning issue is only a little better. The "right" way is simply too computationally intense. One possibility would be to add a configuration option to the system where mobs will only spawn at or near ground level, when so configured (regardless of player Z). Implying that a player on a building will not have mobs spawn in the building with him.

Next item up is the props stuff we discussed, however I'm currently indisposed working some patches to the runuo core itself, for the devs.

C//
 

Gustin

Wanderer
You know, I had a thought. If the props stuff we've discussed is implemented, couldn't you just set the new monsters Z to the players Z? Granted this may not be perfect in all situations but I think that with perhaps some sort of method that unstucks anything caught IN a tile, instead of ON a tile (you know from slight z differences on the map), maybe would be more effective? I know it couldnt possibly be as bad computationally.

Anyway, just a thought. I am not a software engineer, so I'll leave that up to you to decide.
 

Courageous

Wanderer
Noted. I'm currently working on an AI Engine for runuo; will probably be a while before I begin attending to new additions to random encounters.

C//
 

JuVii

Wanderer
Sounds nice. But when i'm trying to install it i get an errormessage like this:

Engines/AI/creature/BaseCreature.cs:
CS0117: Line 1975 'server.mobiles.AIType' does not contain a definition for 'AI_'

Thank you for ur time.
 

Malaperth

Wanderer
I may have missed something very easily, but I didn't see anything in here that needed a BaseCreature edit. Have you edited it recently?
 

warduke

Wanderer
Hello

I do not have a fresh install so this error may be something on my end. With the two scripts EncounterEngine.cs and Import.cs its says in a few locations "The name 'Helpers' does not exist in the current context"

Thanks.
 

JuVii

Wanderer
infact im working with two different computers, other with an edited one and other with original, but still get the same weird error. Gonna try restore my backups to be sure.
 

Malaperth

Wanderer
Just a guess, JuVii, but search through your BaseCreature for AI_ and see if you may have a space between AI_ and Necro, for example.
 

Courageous

Wanderer
I do not have a fresh install so this error may be something on my end. With the two scripts EncounterEngine.cs and Import.cs its says in a few locations "The name 'Helpers' does not exist in the current context"

I will look at this tonite when I get home. Sounds like a possible packaging problem.

Peeked quickly at source. Please post the exact error with your server running with the debug flag.

C//
 

warduke

Wanderer
Thx

Courageous said:
I will look at this tonite when I get home. Sounds like a possible packaging problem.

Peeked quickly at source. Please post the exact error with your server running with the debug flag.

C//

RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
Errors:
+ Custom/EncounterEngine.cs:
CS0103: Line 560: The name 'Helpers' does not exist in the current context
CS0103: Line 616: The name 'Helpers' does not exist in the current context
CS0103: Line 617: The name 'Helpers' does not exist in the current context
CS0103: Line 701: The name 'Helpers' does not exist in the current context
CS0103: Line 717: The name 'Helpers' does not exist in the current context
CS0103: Line 934: The name 'Helpers' does not exist in the current context
CS0103: Line 936: The name 'Helpers' does not exist in the current context
+ Custom/Import.cs:
CS0103: Line 305: The name 'Helpers' does not exist in the current context
CS0103: Line 374: The name 'Helpers' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Courageous

Wanderer
Where is your file Helpers.cs located? Both the EncounterEngine and the Helpers class are supposed to be in the namespace Server.Misc. There is supposed to be a file called Helpers.cs in your RandomEncounters directory.

I have the same config that you do, it would so appear, and it compiles and runs.

It looks to me as if Helpers.cs either doesn't exist or is in a different namespace than the EncounterEngine.

You may wish to look at the original zip file attached. I do recall that there was an adjustment made a day or so after the first post where a correction was made; if you have that very early copy, you need to get it again. If you got it recently, I am puzzled. It appears something is out of whack on your end.

C//
 

warduke

Wanderer
INSTALLATION

Extract the zip file into your Scripts/Custom directory. Extract the Searches.zip into your Scripts/Custom directory.

I didnt make a folder I just unzipped into the custom directory.

RunUO/Scripts/Custom
 

Courageous

Wanderer
Yeah, I noticed that when I d/l'ed it at work. This won't effect the compile, but it won't run if it cannot find RandomEncounter.xml at ./Scripts/Custom/RandomEncounters/RandomEncounters.xml

You can of course set that as a variable to fix the problem.

Something is awry. I have what you have, have downloaded it as is (set aside my current working RandomEncounters), even unpacked it the way you did. It compiles.

Helpers.cs contains the Helpers class, and it is in the correct package.

Do you have a Helpers.cs file?

Sounds like you don't.

C//
 
Top