Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Command line solving ?

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Oct 2017 20:23
When I studied at University I remember being shown a method that I thought was perfect for deciphering DOS command line commands
I remember thinking for myself it would be really great for AI and a specific project I want to get back into.

This was a very good way of dealing with a heap of variations without a huge amount of conditional statements

Explaining this a DOS command can have a huge number of switches or optional parameters but depending on what parameters can take a
completely path. For example if option [a] and [c] exist than it would for [a] or even [a] and [d]. I understand you need some conditional statements but
there's a way of doing it without every possible path, considering you may have 20 switches. I hope that clears up what I'm after, it was a certain
framework and solution like pseudocode but could've been a language in itself. If anyone can shed light or a direction on where I can find this info
it would be greatly appreciated.

I also believe it would be a great way of coding AI for a particular program I have in mind as you could have many variations each with its own effects
Its very similar but a simplified version of like a computer program can be coded in many variations

Thanks in Advance
fubar
ShaunRW
DBPro Developer
16
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 11th Oct 2017 00:07 Edited at: 11th Oct 2017 00:18
I've recently been thinking about creating an ingame console for my projects.

I decided to define the commands in a json file which matches the command and argument count to a 'procedure'.


Then in AppGameKit, I would parse the input string to determine the procedure and get the arg list. Then run the 'procedure', and I know the correct number of args exist.


I have even toyed with the idea of having sub-commands. That json might look like,

This would define these commands:
console.clear
console.close
console.resize ( size | width, Height )
console.save ( file )
player.kill
player.sethealth ( health )


This might not be exactly what you're after, but its something similar that I have come up with.

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Oct 2017 00:26 Edited at: 11th Oct 2017 00:39
I'm still yet to learn what JSON is really about
Quote: " This might not be exactly what you're after, but its something similar that I have come up with."

This may be exactly what I need (a console inside a basic programming language)
Looking up about JSON now thanks ShaunRW

Ideally I want a serious of commands with arguments
That I can run turn based depending on which bot is using them like CROBOTS
I have been working on a GUI version well in my todo list using logic gates
This an older thread I started you may or may not wish to read
https://forum.thegamecreators.com/thread/216811
fubar
ShaunRW
DBPro Developer
16
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 11th Oct 2017 01:05
Sorry I should also note the json is completely optional. It is just a way I store the user defined type data. The udt is what actually holds the data when parsing the console input string. You can setup this data manually in code if you wish.

I have a UDTs somewhat like this.


fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Oct 2017 02:05 Edited at: 11th Oct 2017 02:09
ok so if I'm understanding this correctly I could create something
like in this JSON snippet


and also have the added gate handling saved in each player ie if it sees an and gate after a command then look at the next command for example
fubar
ShaunRW
DBPro Developer
16
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 11th Oct 2017 03:43
Well my idea was for an basic console interface, not so much ai scripting. Depending on the complexity your robots ai can get, you may need an actual scripting language.
Going by the thread you linked, it sounds like you want the player to program the robots using visual scripting, kind of like Unreal Engine Blueprints?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Oct 2017 06:24
but very simplified
ie if a and b then c
if a or b then d
etc

and run through a list of the commands one at a time
CROBOTS users a timer event
but what I want to do is make it more turn based like I have seen on my old Atari ST
Where you just soldered components then put it to test against other robots

I have it basically doing what I want without the use of gates ATM but It will have a scan option
that might mean if scan=true then shoot else do something else like rotate shoot pause move etc

fubar
ShaunRW
DBPro Developer
16
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 11th Oct 2017 08:02 Edited at: 11th Oct 2017 08:32
Ok, so, I would create a RobotModule type to represent a electronic components. These modules can have inputs, outputs, and code to run that effect the outputs based on the state of the inputs.

For example:


So the program start off by executing the first module, maybe there's always a start module that always has a 'on' output. Then process the module indicated by output.LinkedModuleID. You would keep processing this tree of outputs until there are no more modules to run. This should give you scripted behaviour.

I haven't tested this at all so take it as just an idea.

Login to post a reply

Server time is: 2024-11-23 02:17:27
Your offset time is: 2024-11-23 02:17:27