[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 379: 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/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/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/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 - experiments with AI
Showcase
Showcase your work that you have created in the Skyline Game Engine.

experiments with AI

experiments with AI

Postby ant0N » 16 Mar 2015, 18:13

it came to artificial intelligence! :) Two days of trying to create a simple and extensible AI and I think I did it!
I will post in this thread my progress.

:D this is only the beginning.
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: experiments with AI

Postby SolarPortal » 16 Mar 2015, 18:27

nice one antON :) It seems you have got the navmesh under control.
I am looking forward to seeing where this leads.

the dofile looks like it is going to have a problem if you pass it to another user as it is hard coded.
i will have a look into this now and get back to you as i am sure there is a way of making it relative.



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: experiments with AI

Postby ant0N » 16 Mar 2015, 18:32

Thank you!
Yes, dofile() I could not get it to work otherwise..
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: experiments with AI

Postby StarFire » 16 Mar 2015, 20:32

Cool mini matrix!, looking forward to seeing this develop. Keep up the great work :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: experiments with AI

Postby SolarPortal » 16 Mar 2015, 20:51




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: experiments with AI

Postby Shando » 17 Mar 2015, 01:44

Hi ant0N,

Looks like we are working on the same thing :D

I've just (almost) finished some AI Behaviours ( Seek, Flee, Evade, Pursue, Arrive & Follow ), which I'm testing and tweaking. My version does NOT use any of the NavMesh, but solely relies on Vectors etc. (based on the famous work by Craig Reynolds and the AI in another engine). Though I'm sure adding in the NavMesh wouldn't be too tricky :?:

I'll pm you my script as it is now so you can take a look ( it's not commented, so might be a bit tricky to understand in places :oops: ).

One question....... Does the "doFile" work in the same way as "requires"? From what I've read, doFile runs the entire called file in one go, and requires includes the called file (similar to C++), which allows you to call individual functions from it.

Keep up the great work!!!

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: experiments with AI

Postby TattieBoJangle » 17 Mar 2015, 01:57

User avatar
TattieBoJangle
Community Manager
Community Manager
 
Posts: 858
Joined: 26 Jan 2015, 00:15
Location: United Kingdom
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer
Skill: Great creative

Re: experiments with AI

Postby SolarPortal » 17 Mar 2015, 10:50

its good to see everyone working together and looking forward to that AI shando.

require is like loadFile where it loads the script, but none of it is executed and running in the state. This means you have to pcall to the loaded lua and execute it manually. This doesn't work in skyline as they files need to be running in the actual "Lua_State". This method is used when you need to change or add extra arguments to a lua script which does not need done inside skyline.
Basically, these methods are not used at all unless you execute the scripts manually which is not possible as skyline is running the lua states immediately when play the game is pressed.

This is where doFile() comes in, since you are playing the game and the script you are wanting to load has the functions you need. It needs to be running inside the "Lua_State" the same as the script it is called into in order to access variables or functions.

Another way of thinking of this is; that it just adds the contents of the lua script you are including into the script you need to reference, so the functions/variables are directly accessible.

The new "sky.include()" is a c++ implementation of the dofile() and dostring() approach, where you only need to pass a single filename and it will be located between editor, game and player.

In our function for the end game, we get the contents of the lua script from the loaded resources from an archive as a string from a stream and use the dostring() function instead of dofile() which is used in the editor and player. This has created compatibility right across skyline. So in the next version of skyline, this is the function you will want to use instead of dofile, loadfile, require etc...



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: experiments with AI

Postby SolarPortal » 17 Mar 2015, 15:42




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: experiments with AI

Postby ant0N » 17 Mar 2015, 16:09

it is planned in the next release? :)
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: experiments with AI

Postby SolarPortal » 17 Mar 2015, 16:29

the "sky.include()" function which replaces dofile() has been added, tested and will be in the next release, yes :D



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: experiments with AI

Postby Shando » 18 Mar 2015, 00:24

Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: experiments with AI

Postby SolarPortal » 18 Mar 2015, 10:37

yes, each one has its own copy as each entity has its own "Lua_State". The code brought in must exist within the state in order to be called.

Lua files that are brought in through the include cannot have any skyline functions: e.g.
onInit(), onUpdate() as they are not called in that script. But all skyline libraries, e.g. entity, physics, vehicle etc.. can be used.



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


Return to Showcase

Who is online

Users browsing this forum: No registered users and 3 guests