Jump to content

Sign in to follow this  
DBR_ONIX

Web-based RTS with Flashpoint AI

Recommended Posts

{Note : itallic bits aren't too important, bold bits are the ones most people should pay attention to tounge2.gif}

While replying to a post in the FWATCH thread I started a few days ago, I came up with an idea..

A web interface, with the locations of your soldiers, and the enemies, denoted by small dots.

When you click on the map, the coordinates get passed into OFP, and the group starts heading there.. One player controls one side (So up to 3 players)

The group will act like normal OFP AI, and will shoot the other team.. Think of this like an online RTS game, but with OFP's AI..

A few ideas to extend this : Obvious adding vehicles, controlling more units (right now it's designed for 8 units per side, just for ease of coding), creating bases etc.. Web-based CTI?

"Get Intel" button, which would make a spy-drone fly over a specific location, and take a "photo" (screenshot), and is made visible to the player - Problem with this is I'd like to keep it as compatible with dedicated servers, on both windows and linux.. This'd require two programs to take the screenshots, and either the server to be running in serve-and-play mode, or to have a client to take screenshots, which starts getting hard to program..

Problems : Since players are controling semi-phsyical units (i.e tying up a server), it's not hugely very scalable, not helped by the ammount of data that would need to be passed into/out of OFP via FWATCH..

So, what would people think of such a thing? For now it'd more be a proof-of-concept thing.. The first version would basicly let you move around units, who would then attack the enemy if they could, and keep some form of score

[wandering of topic here, but oh well],But with Armed Assault's JiP feature, and hopefully MP-saving/loading (or atleast better file reading/writing), it could be extremely usefull.. Log in and manage your RPG character, get them to move around etc..

the server could keep a database (mysql, say) of player names, a password, inventory etc. When you join the game, your password (read from a file, or messaged somehow) is checked, if it's right it loads your stats, and you contiue playing.. You could move around and control your player from the web interface etc..

Or, being able to drop in the game at any time, while your at work/school, you could keep an eye on your squad, order them to move/hide/attack, then when you get back, you can join the server and take control of the leader.. For presistant-world type games (Capture the Island), or RPG's, a web control panel could be usefull..[End wandering]

- Ben

PS, so far the requirements would be to have OFP running with FWATCH (Can't remeber if the dedicated servers works with it, but I think it should..), and to be running a webserver with PHP (Apache/PHP, for eaxmple).. In the future it should be possible to run the scripts on a seperate server, and have the server get the data either via a small script, or FTP

Share this post


Link to post
Share on other sites

Aaarh, and i thought that idea (mainly for ArmA) was a unique one crazy_o.gif

Definately will follow this! Maybe i also misunderstood, but if it´s what i think then it´d be time for the banana dance inlove.gif

Share this post


Link to post
Share on other sites

I think its a good idea. My first thoughts are along the lines of adding dual monitor support to OFP,itd be nice to display the map,especially if your commander.

Mission status,RTS scripts...all kinds of ideas pop in mind

Share this post


Link to post
Share on other sites

Small progress report : It's easier than I thought it would be..

I've got the script (PHP) to send positions to FWATCH, and the OFP script to read the positions..

The way it ended up being coded is more scalable than I first thought, particularly using dynamic varible names in the OFP script.. Basicly the script is run on each group leader as

[this,group1] exec "script.sqs"

Then it works out the filename like

_file=FORMAT["%1_in.rts",group_name];

So, in the squad-select bit, you define how many squads are setup (or it could be worked by writing group1=true in an fwatch file, for each group.. Hmm)

Cherry has the hardest job I think, maping the map-interface accurate to in-game coordinates.. But assuming no huge problem in that, I expect an alpha version to be ready if not tonight, by tomorrow smile_o.gif

One thing I've not worked out, when a soldier dies, what happens? Do they respawn? Do they wait till all soldiers (or 90% anyway) are dead, then group-respawn? Not sure..

- Ben

Share this post


Link to post
Share on other sites

Damn your fast! Although the faster it goes it seems i guessed wrong about the similarities between our ideas. Really gotta pm ya..if only my thoughts were more english crazy_o.gif

Share this post


Link to post
Share on other sites

sounds like a fantastic idea ,just like your camera thing dbr , nice one smile_o.gif. just one point on the mapping, its not my thing ,but just a thought, is the coc matrix thing any use ,or am i way off the mark as usual :0.

Share this post


Link to post
Share on other sites

Done : PHP script to take data from map-click to an FWATCH file (need to work out coordinate conversions, but shouldn't be too hard)

Flashpoint script to take coordinates made by PHP scripts, and move soldiers move to the right coordinates

Flashpoint script that sends all units coordinates to an fwatch file

PHP script that takes this fwatch file, and outputs it ready for displaying on the map

Buuut, due to fun things like cross-browser compatability, the front end is taking a bit longer than expected.. Basicly the pop-up you get when you click only works in IE.. Wouldn't be too bad but the system we were going to use for positioning the dots for soldiers uses the same thing..

So, we have two options..

Don't live update the icon markers, and just reload the entire page, while it'll work, I don't think it'll look nearly as shiney, and might be slightly annoying to use

Or, work out a method of dynamicly positioning div tags using Javascript, that will work in Firefox, Internet Explorer, and Opera (Starting from highest priority, to lowest).. I'm almost 100% sure it's possible (as I've seen it done)..

Cherry might manage something, but is there anyone good with Javascript who knows how to do this? If so, could you PM me inlove.giftounge2.gif

If I get this damned javascript working, the only thing left is to convert the javascript (the image-map) coordinates to ingame coordinates and it's ready for testing smile_o.gif

So, javascripty people, heelp sad_o.gif

- Ben

Share this post


Link to post
Share on other sites

Pre-Alpha Test video!

http://thepiratebay.org/details.php?id=3501771

or

http://www.dbrweb.co.uk/ofp-rts/OFP-RTS_Demo1.mov.torrent

It's using tanks for this example, but the final version will probably use soldiers.. Although with tanks could work (It's very easy to change them anyway)

Very tired today, so won't get much done.. Fixed a lot of script-errors, getStatus isn't behaving right, so I'll fix that

Small update : Sorted that fecking script somewhat (it not works, but I've no idea why it didn't work). I've also got a few people to test it, without an interface, by running OFP on the laptop, along with Apache, and getting them to put in coordinates

"That is so bloody cool", "thats sweet" etc tounge2.gif

- Ben

Share this post


Link to post
Share on other sites

This looking very promising, ill be keeping an eye on it biggrin_o.gif

Keep up the good (and bloody fast) work!

Share this post


Link to post
Share on other sites

Sure but if there is no one who host this in torent you got nothing ;-)

Share this post


Link to post
Share on other sites

Strange, it's worked for others, oh well smile_o.gif

Still looking for people good with Javascript or Flash *hint hint* tounge2.gif

- Ben

Share this post


Link to post
Share on other sites

Update : Front end is half done.. Gone are the evil browser compatability problems.. We're working on the image coordinates to OFP coordinates conversions now (Well, Cherry and DaveP are, I'm writing this just now tounge2.gif)

After it's done, we'll display the units on the map, test, then release smile_o.gif

Update 2 (didn't want 3 posts in a row icon_rolleyes.gif ) :

We have pretty much all the javascript in place, just a few problems left to sort out, and it's done.. Assuming theres no huge problems, a beta version will be released tomorrow evening smile_o.gif

- Ben

Share this post


Link to post
Share on other sites

This is the first I've read of this and it sounds kickass. Downloading torrent now but thats about 2 hours away. My first and only question for the moment is... Will it be possible via the web interface to change your groups formation? Like Infantry groups could be set to line formation while they're cresting a ridge and be issued another formation when they reach the top.

Share this post


Link to post
Share on other sites

This looks sweet, is it going to be complicated to use or simple point and click? Would be cool to have people just controling small squads and an overal CO to overwatch and guide each one (maybe against AI sometimes etc) notworthy.gif

Share this post


Link to post
Share on other sites

Hi!

I think your idea can be used in something bigger then a flashpoint based RTS game. IMHO it can be used to create a dynamic war simulation system - something similar to this what was shown in GAME2 - dynamic campaing where every step you have taken will have influence on current situation. Why?

Global AI responsible for strategy can be managed by external program - as advanced as programmer can write it.

This is great step forward in 'evolution' of flashpoint AI.

I imagine it in this way:

Player start up this AI server, then he lunches, flashpoint and then special mission. This single mission is whole campain. Server generates first mission on runtime, set up forces of your army and opponets army, then he set up plans operational, and procced to execute them. When something unexpected happens (for example battel for a town is lost, casulties are high etc), AI changes plans and execute them further. Same goes for the opponent. When player will be in something like this - he will get a strange feeling of war camapaing going on screen of his/her PC.

What do you think?

Share this post


Link to post
Share on other sites

The controls will be (for now) extremely simple, just click to move the soldiers.. Originally there was going to be a (javascript) popup when you clicked, that you selected different move types, formations, guard, watch direction etc.. But thanks to browser-compatabilities it was dropped (It's still there, it's just hidden, and the PHP scripts doesn't have it implimented)

It's totally possible to add though.. For now, this is just to prove the idea works smile_o.gif

The external AI management is possible, but it would put a lot of train on the system reading data in/out of OFP fast enough to be of use I think (Depending on how specific you want to control the units.. To move them to specific points, say, it's quite possible, but then you get problems like accidently moving them over water, which is hard to detect out-of-game etc etc..)

It shoould be done in 2 days time, having a slight problem with the javascript to update the soldiers markers, and the fact Cherry's busy just now.. So, when either a good javascript-y person PM's me, or Cherry gets round to it, it'll be done smile_o.gif

- Ben

Share this post


Link to post
Share on other sites

biggrin_o.gif It's very nearly done, fixed that stupid error that was stopping the markers getting refreshed, going to eat, then sort the image-to-OFP-grid conversions, test, should ready for release by 8PM GMT smile_o.gif

- Ben

Share this post


Link to post
Share on other sites

this does, indeed, sound very cool and interesting.

One thing though, maybe there could be a way to allow spectators IN OFP? Like you start the server, etc. and there are a few people just sitting there watching the units move around from orders given out of game? That could be either really interesting or incredibely boring confused_o.gif

Or maybe a sort of smart-dynamic-AI thing where you are a soldier in the group (not leader) and you are to partake in this mission? Might be ineteresting.

I'm interested in the way this turns out.

Share this post


Link to post
Share on other sites

Tada yay.gif

http://www.dbrweb.co.uk/ofp-rts/OFP-RTS_v0-1_PreAlpha.rar

Read the !readme_documentation file, this is NOT the final version smile_o.gif

Any questions and the likes, ask here xmas_o.gif

- Ben

{Edit : snuffles : It's possible to be ingame as the units are moving about, the test mission puts the player as a commander in one of the tanks. It would also be possible to incorporate my OFP Camera program to put live-screenshots of the mission on the web-server wink_o.gif}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×