[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4771: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4773: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4774: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4775: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
Skyline Forums • View topic - Skyline Concept of an Engine Module?
Skyline Editor related tips n tricks!

Skyline Concept of an Engine Module?

Skyline Concept of an Engine Module?

Postby Olander » 04 Feb 2017, 00:52

Hi all

<=EDITED AND UPDATED FOR INFORMATION=>
To help assist as a helpful guideline of how the Module (from Bioware) is set up and used. I have left out events that are not really used from the NWN Lexicon (for others familiar with NWN1 Aurora).

Module (object oModule)
Module Variables: For Global Data and Configuration Settings
Module Events:
OnModuleLoad - Lua script that runs when the Engine Loads
OnHeartbeat - Lua Script that runs on a module cycle. Should be on 100ms intervals.
OnClientEnter - Lua script that runs when a Client Connects to the game
OnClientLeave - Lua script that runs when a Client Disconnects from the game

Subset of oModule:
--Area (object oArea) = Levels/Scenes :: References to scenes in oModule kept in an array for engine access
Area Variables: For Local Area Based Variables
Area Events:
OnEnter
OnExit
OnHeartbeat (Only active while a Client is in the Area) 100ms update rate
object oObjects = Non-Static Objects that have scripts running. Kept in a list of the oArea
Variables

Module Functions:
object GetModule();
int GetTimeYear();
int GetTimeMonth();
int GetTimeDay();
int GetTimeHour();
float GetTimeHourDecimal(); <= 12.3456789 hours of current day length
int GetTimeMinute();
int GetTimeSecond();

Area and Object Functions:
object GetEnteringObject(); Gets the object that last opened or entered the calling object.
object GetExitingObject(); Get the object that last left the calling object.
object GetArea(object oTarget); Get the area that the target is located.

General All Use Functions:
General Functions that are fabulously useful but must be designed into how the engine works. These functions work on any entity, Area, and Module. Internally I am not certain how Bioware is doing this. In Unity and UE4 I made 2 dimensional arrays and populated these when the object is initialized/instantiated...etc. My arrays were set to 1000 variables possible to keep speed up and give enough room to store enough variable data for usage. The sVarName must be Unique so that the Array is being searched the sVarName Sets/Gets the proper data.
int GetLocalInt(object oObject, string sVarName);
void SetLocalInt(object oObject, string sVarName, int nValue);
float GetLocalFloat(object oObject, string sVarName);
void SetLocalFloat(object oObject, string sVarName, float fValue);
string GetLocalString(object oObject, string sVarName);
void SetLocalString(object oObject, string sVarName, string sValue);
object GetLocalObject(object oObject, string sVarName);
void SetLocalObject(object oObject, string sVarName, object oValue);
location GetLocalLocation(object oObject, string sVarName);
void SetLocalLocation(object oObject, string sVarName, location lValue); <= location lValue = Vector3 float x, float y, float z



<=INITIAL POST=>
Ticking off items on the list for this engine I could not find something. The Engine Script...or call this...Module

Something that was incredibly important in the Bioware Aurora Engine (NWN) is called Module. This is the Engine Entity (object) that can run scripts and hold information. It cannot be set directly like other objects (meaning cannot be edited/placed in a scene) and is rather special. Its main task is at runtime in handling lots of global information and the transfer of this information to/from scene/level objects.
examples:
- Global Time
- Global Engine Configurations
- Global Data to Transfer between Scenes
- Global Heartbeats
- Global Transforms of Teleportation Waypoints

In any case. Couple of questions.
If this feature is available in Skyline already...it is not apparent in how this is created.
If this feature can be made in Lua and implement with a Do Not Destroy On Load type mechanism....this will work.

This is a very important feature to a game engine to make all scenes/levels be completely in sync with each other and not simply isolated environments.

Thank You. Cheers
Olander
Last edited by Olander on 05 Feb 2017, 19:04, edited 1 time in total.
User avatar
Olander
Skyline Apprentice
 
Posts: 35
Joined: 29 Jan 2017, 17:36
Skill: Level Designer
Skill: 3D Modeller
Skill: Scripter
Skill: Audio
Skill: Great creative

Re: Skyline Concept of an Engine Module?

Postby SolarPortal » 04 Feb 2017, 13:53




Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Skyline Concept of an Engine Module?

Postby Olander » 04 Feb 2017, 18:06

Hi SolarPortal,

Thank you for the information. I think this would work perfectly in a single player environment. The only question would be how would this be handled in a Multiplayer environment. We are not talking about MMO in this case but simple 70 clients or so connected to the master host server/client.

Since the module is the keeper of data, so to speak, and any client connection points directly to it for any global information. From your scene script example I am not quite certain how this would work.

It might work if all scenes were initialized while loading the build then synchronized on a heartbeat or something. This would mean that the database does actually exist for the scene. And since the master server/client that is hosting the game would then have all the databases necessary. Since clients can be in several different scenes at once syncing the database become a hideous task...which is why the Module exists in the first place.

Both Unity and UE4 I had to do some crazy stuff with text files to make certain the 'Global Database' was synced on both ends. Really surprised that they both have multiplayer in their systems but no decent method to handle global data of any kind. I solved it but it is a very strange and difficult to troubleshoot data issues when they happen....and they do happen. :lol:

It would be very nice to have an Engine/Module script to run things in with a similar fetch call as your scene script. If you have another idea on how to handle the multiplayer issue then that could work as well.

Thank you, Cheers
Olander
User avatar
Olander
Skyline Apprentice
 
Posts: 35
Joined: 29 Jan 2017, 17:36
Skill: Level Designer
Skill: 3D Modeller
Skill: Scripter
Skill: Audio
Skill: Great creative

Re: Skyline Concept of an Engine Module?

Postby SolarPortal » 04 Feb 2017, 20:24

Aah, i see now :)

Currently, there is no multiplayer code built into skyline, but it is developing on the side and we should have some lua libraries implemented soon to handle this.

A system wide script or module would be very cool when considering what you are talking about and we can work this in when skyline gets the networking capability.



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Skyline Concept of an Engine Module?

Postby Olander » 04 Feb 2017, 21:12

Excellent. I will set up the project then with the scene database transfer then once the Engine/Module script is implemented I can transfer the functionality over to that.

Thank you for the assistance.
Cheers
O
User avatar
Olander
Skyline Apprentice
 
Posts: 35
Joined: 29 Jan 2017, 17:36
Skill: Level Designer
Skill: 3D Modeller
Skill: Scripter
Skill: Audio
Skill: Great creative

Re: Skyline Concept of an Engine Module?

Postby SolarPortal » 04 Feb 2017, 22:59

No worries. Happy to help :)



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Skyline Concept of an Engine Module?

Postby Olander » 05 Feb 2017, 19:11

@SolarPortal

I updated the initial posting to help as a guideline for how the Module and Areas are related as well as the most useful functions that are used with them. I also placed some very useful General Functions that are extremely handy for making game design much easier. These are very much an engine based design item since there are so many things that can use these functions from within other functions.

I would be happy to help making a nice library of utility functions in Lua for Skyline to couple with the already nice and growing library posted in the forums here.

Thank you.
Cheers
O
User avatar
Olander
Skyline Apprentice
 
Posts: 35
Joined: 29 Jan 2017, 17:36
Skill: Level Designer
Skill: 3D Modeller
Skill: Scripter
Skill: Audio
Skill: Great creative

Re: Skyline Concept of an Engine Module?

Postby SolarPortal » 05 Feb 2017, 23:52

thanks.. and wow thats quite a hook to add lol :P

It wont be a quick one to implement and it may not be started for a few months as we have some planned tasks which take us up to end of February/march.

I think its going to take some time to digest what your after but we will work towards it and plan it in on the way :)



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Skyline Concept of an Engine Module?

Postby Olander » 07 Feb 2017, 04:06

:D Hook with some lovely yummy bait! :D

No worries at all. For single player what is there is fine with your helpful solution. For all the Set/GetLocals they can be done with what is there as well with the same array process that I had to do in Unity and UE4. I am still learning quite a lot in Skyline...and this is going to take some time. :D

None of the above is mandatory of course. It would indeed be very cool to have such integrated features at the fingertips. Thank you for even being interested in examining this.

Cheers
O
User avatar
Olander
Skyline Apprentice
 
Posts: 35
Joined: 29 Jan 2017, 17:36
Skill: Level Designer
Skill: 3D Modeller
Skill: Scripter
Skill: Audio
Skill: Great creative


Return to Skyline Editor

Who is online

Users browsing this forum: No registered users and 2 guests