Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SphereTables.scp
Author Message
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #1
SphereTables.scp
So this past week I have been helping a server with simple bugs and such and something dawned on me. I don't use the base packs you all do. So I installed the packs that have apparently been modded a good bit since I left the last time... and lo and behold... a lot of issues. Okay, so the biggest part of this could come down to something I am fiddling with at the moment. Sphere loads with an Order of Operations. This is called from SphereTables.scp. Now, the person who messed up this order won't be called out, but things are not loading in the proper order as the hard code would like it. This in turn could be causing possible exceptions.

People do not realize how important it is to have this table right. Even where they tell you to add custom code is wrong. You need to do it in proper orders, which I am still fiddling with. Since some things have dependencies on things people don't expect.

Anyone willing to help try to give this some rational sense, please pipe in and let me know if this order is making issues for you. So far it is working a lot better on two servers for people. The old SphereTables.scp from Pre-Releases is similar to this structure, whereas Nightlies ARE NOT. If you use Nightlies, try to match this.

You can see where things SHOULD be. So if you have relational code, please place it UNDER the core code for that type of code

This is what I have come up with so far with no current issues at the moment. Please note I added in all the missing [TEMPLATE] scripts at the end. They were loading with 'Scripts/' which severely breaks their loading operations.
Code:
[RESOURCES]
// sphere.ini and spheretable.scp are automatic.
// All the other scripts we want to load.
scripts/sphere_defs.scp        // SHOULD LOAD FIRST.
scripts/sphere_types.scp    // SECOND. Terrain types are important.
scripts/sphere_events_human.scp    // We process Event triggers here. Please put custom event/typedef triggers in this area.
scripts/sphere_events_npcs.scp
scripts/sphere_backward_compatibility.scp    // We should process this after types and defs just in case.
scripts/sphere_admin.scp                // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_dialog.scp                // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_menu.scp                // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_serv_triggers.scp        // Server dependent functions. This probably should be a priority script.
scripts/sphere_add_sqlite.scp        // Dependency if you are using it.
scripts/sphere_skills.scp            // Definitions with no Items attached. (Move up?)
scripts/sphere_skillmenu.scp        // This should follow skills honesty.
scripts/sphere_newb.scp                // Technically a resource.
scripts/sphere_book.scp            // Only top if using the MOD/Scroll blocks. (Sounds right.)
scripts/sphere_name.scp            // Might be able to move this to the bottom of operations.
scripts/sphere_speech.scp        // Might be able to move this to the bottom of operations.

// Items And Npcs. NPC's loaded after items due to Dependencies.
// Must be loaded in this order. Please place your custom items after the scripts/items/
// Follow the same logics for scripts/npcs/
scripts/items/
scripts/npcs/

// Maps //
// Make sure regions are loaded before any map.
// Note: Still some odd issues defining [RegionType]; This needs to be looked into. Moving sphere_Defs.scp NEEDSTOFIX r_* t_Junk caused some odd errors
//  with r_civilization and such. It was issues with Npcs though. Maybe NPC's actually should load AFTER maps? Need to double check now the order of
//  operations is (hopefully) set in the right order. If not, new defines being called by creatures should give consideration to move down Mobiles in hierarchy.
scripts/sphere_region.scp
scripts/maps/sphere_map0.scp
scripts/maps/sphere_map0_ml.scp
scripts/maps/sphere_map1.scp
scripts/maps/sphere_map2.scp
scripts/maps/sphere_map3.scp
scripts/maps/sphere_map4.scp
scripts/maps/sphere_map5.scp
scripts/maps/sphere_map_points0.scp
scripts/maps/sphere_map_points0_ml.scp
scripts/maps/sphere_map_points1.scp
scripts/maps/sphere_map_points2.scp
scripts/maps/sphere_map_points3.scp
scripts/maps/sphere_map_points4.scp
scripts/maps/sphere_map_points5.scp

// Dependent on CharDef and ItemDef being loaded prior. So load these aafter those files.
scripts/sphere_spells.scp
scripts/sphere_spawns.scp

scripts/stones/
scripts/stones/guilds/
scripts/stones/towns/

// Speech Files
scripts/speech/

// These are getting changed. Most of these were not even put in here and they NEED to be.
// If you add any [TEMPLATE ] files through a custom script, put them in these files or a custom one and PUT IT IN THIS BLOCK.
// It was missing 5 of these, which will load when scripts/ loads. Breaking order of operations/Hierarchy/dependencies.
// Templates //
scripts/sphere_template.scp
scripts/sphere_template_loot.scp
scripts/sphere_template_vend.scp
scripts/sphere_template_armor.scp
scripts/sphere_template_weapons.scp
scripts/sphere_template_sets.scp
scripts/sphere_template_misc.scp
scripts/sphere_template_magic.scp

Note: With backwards compat. If you do not need it, remove it. It is memory consuming and as heavily edited as it is, if you are not using the definitions from changes, you should do that as soon as possible. This is only supplied for a temp fix. The bigger this file gets, the more memory it consumes. Change it all as soon as possible.
(This post was last modified: 03-02-2016 03:57 AM by Khaos.)
03-02-2016 03:39 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Khaos's post
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #2
RE: SphereTables.scp
https://github.com/Kaylala/SphereBaseScripts

This is the new base project. Trust me, I am breaking everything down.
03-25-2016 04:20 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #3
RE: SphereTables.scp
Yes, but again, we are trying to teach people this strict method of calls. Just like your code you sent me in PM. You were parsing 13E3 without a prefix of 0. Sphere will try and read that and it will error without the 0 before it, unless you wrote it out as its integer offset.

Then the shortcutting using tBSTool is something we are moving away from. Shortcuts like that for code you will barely write or check are just not good practice.

Sorry. Just soon as base pack is done, I highly suggest you use it. It will clean up the bad practices this community is so hell bent on sticking with.
03-26-2016 03:26 AM
Find all posts by this user Like Post Quote this message in a reply
Trip
Apprentice
*

Posts: 15
Likes Given: 5
Likes Received: 7 in 6 posts
Joined: Mar 2016
Reputation: 0



Post: #4
RE: SphereTables.scp
I see where you are coming from but, those are not hard coded right?
What, I'm asking is, it's just an entry in the ini file that reflects the name of the script right?
I mean, if I change scripts/sphere_template_armor.scp to Templates/Armor.scp and reflect the change in the ini it will still work right?
The server isn't going to get mad at me and start spitting at me? lol

Sorry, I never been a big fan of underscores and I simply detest lengthy names.
Just a preference and my system hates them ( Linux with a windows compatibility plugin ).


So, the banana says to the Mi
nion..............
03-29-2016 07:07 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #5
RE: SphereTables.scp
Yes, that is fine. You just have the keep Hierarchy about the same. Look at my Base Packs I am working on in GitHub and look through my files after checking out SphereTables.scp in my files. Nothing is named the same anymore minus Items I am working through. Broke down a lot of files, but kept the loading orders by doing their breakdowns in files and just loading the files in old orders. Smile So Sphere_Defs.scp which was one file is now checking for a folder of like 18 files. Smile

Personally, I prefer RunUO's organization schema. People complain it takes longer for server load up, but I don't know a single real online game that is up in 2 minutes like Sphere. Most games are as organized as RunUO is in their files and a 10 - 30 minute loadup is not a bad thing. People expect it honestly, since most games go down for an hour maintenance easy. 10 - 15 minutes tops wouldn't hurt a player base.
(This post was last modified: 03-29-2016 06:25 PM by Khaos.)
03-29-2016 06:23 PM
Find all posts by this user Like Post Quote this message in a reply
Trip
Apprentice
*

Posts: 15
Likes Given: 5
Likes Received: 7 in 6 posts
Joined: Mar 2016
Reputation: 0



Post: #6
RE: SphereTables.scp
True.
I won't tell you then that my own server goes up in 30 seconds with no errors. (that's 11 maps and more than 50k items)
Plus I have zero lag.
Shhh, it's a secret.

It really is all about how the files are done, organized and in which order they load when it comes to server software.
Although, I have a huge secret on how to significantly speedup game speed, load time and such but, it has nothing to do with the software or the amount of files you have or don't have.

I'm waiting to see how things go before I start putting my 2 cents worth in though.
There are some significant diffrences in the different programs there are for running UO for a free shard.
The one major thing I'm waiting to see is if there is a way to add additional maps to UO in sphere beyond the defaults.
With the software I have now, I have 4 additional maps that are nothing but Dungeon maps (Trammel, Felucca, Malas, Ishenar, Tokuno Islands, Malas, plus 4 submaps for dungeons). I redid all my original default maps though and renamed them as well. I figured out quite by accident how to add additional maps but, I'm not quite ready to share that info.
We have to keep some things for ourselves right? lol

I'm switching to sphere as an experiment to compare the 2 software environments.
So for now, my server is offline until I have completed the comparison.


So, the banana says to the Mi
nion..............
04-02-2016 04:54 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Trip's post
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #7
RE: SphereTables.scp
This girl would be interested in learning how to add more maps for sure! Since it is something that never was played with on my end! Let me know how this works out! Super highly interested!
04-02-2016 02:09 PM
Find all posts by this user Like Post Quote this message in a reply
Trip
Apprentice
*

Posts: 15
Likes Given: 5
Likes Received: 7 in 6 posts
Joined: Mar 2016
Reputation: 0



Post: #8
RE: SphereTables.scp
I will. I gotta find out more about sphere first.
As far as I know I am the only person from RunUO that had figured out how to add extra maps.

Like I said, I discovered it entirely by accident when I was making my custom maps. Talk about lottery odds and luck.

I only used the extra maps for dungeons and an advanced playing level where the creatures do 200+ damage with one hit and have in excess of 5000 hitpoints.

I tell you what is really popular.
Letting people max all the skills on one character to 200 instead of 125 on just 7.
Also adding stuff like loot balancing scripts (You'll pardon me if I don't post mine).
It's one where the gold doesn't appear on the corpse of the creature you just killed but instead, a gold check drops into the packs of the players in amounts calculated by the amount of damage they have done when the creature dies. (This is only on the high end creatures though0.

That and no power scrolls.
Mine was set to .1 point for every successful skill use up to level 25 then 1 point for every 5 success'.
then 1 point for every 10 and so forth.

Something else too, special clothing with an extra prefix or suffix when they max all skills to 200.

People love to brag and show off at the bank when they got something that is very difficult to obtain lol.

OSI, ruined the economy and a lot of things in UO before they sold it out.
When I was playing on freeshards before I got one of my own, I also noticed a lot of shard runners didn't do much better.
This based solely on my own experience in shards I dealt with. I know there are good servers out there though ran by people who have a good handle on what they are doing.

My biggest advantage was I listened to my players and kept everything balanced.
Nothing on my server vendor was sold that could be gotten through normal game play or would hurt the ingame economy, and this is the biggest plus of all,
I didn't have custom creations people were forced to purchase in order to play in the dungeons like some do, *cough* Pandora*cough*.

I'm sorry, I'm not ranting, I just love bouncing ideas about what may or may not make a good game.
Don't misread me here, I'm not ranting and I'm not trying to make anybody mad. It's only an opinion based on what I've personally experienced and heard other people say.

I'm not just a UO player, I'm also a client lol.

The biggest thing I'm looking at is the server itself.
At first the extra maps and items worked perfectly but, through experimentation I found that once you hit around 125k items in the game, the server starts bogging down bad when you have more than 75 people logged on at once. Or at least, mine did.

The ram on my server [(1U Short Depth Server Xeon E3 v3) x2] is maxxed out.
I'm on a T1 line (ran through my business, nice tax write off lol).
So, I want to get past that limit on in game items.

I've used CentrEd a lot to make most of my buidings and dungeons part of the maps.
Still, eventhough you can add more maps as you go, they are no good unless you can populate and decorate them.


So, the banana says to the Mi
nion..............
04-02-2016 10:55 PM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #9
RE: SphereTables.scp
Hey khaos,

For instance, what if I have an item and an NPC in the same script. Will I have any issue if the NPC is scripted first in the file than the item?

In your structure NPC's come after the items, that's why I'm asking.

Also, I may not want to have all my items in the same folder, aka scripts/item, so I can just add lines like scripts/blabla/item1.scp; scripts/omgomg/item2.scp and so on?

The loading order always confused me, because if you resync you never have any problem, but when first loading the scripts it's everything a mess.
07-09-2016 08:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)