Recent topics Log in
Search Profile
Memberlist Usergroups
Log in to check your private messages
Register
Battle graphics
Post new topic   Reply to topic
SpaceTrace Forum Forum Index » Suggestions » Battle graphics
View previous topic :: View next topic  
Author Message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Wed Jan 14, 2009 12:29 am    Post subject: Battle graphics
Reply with quote

Hi there;


I'm wondering:
Has someone made a battle graphics application? E.g. something that gives a nice and exciting step-by-step presentation of battles?

If not, I think that given a reasonably detailed output format, from the battle engine, many of us could build a cool battle graphics application.

PREREQUISITES
take the current detailed battle report, and modify as follows:
instead of the grouped sub-battle events, such as:
<CUT FROM BR>
your class 2 vs enemy class 1: V ^
you:
68 eagles
13 wasps
1 sporogenator
enemy:
42 interceptors
116 blockade runners
----------------------------------------------------
12 wasps increased the firepower of 48 ships
2 wasps vs 1 blockade runner
1 wasp increased the firepower of 2 ships
1 sporogenator releases sporators 3 ships
3 wasps vs 3 interceptors
8 wasps vs 8 blockade runners
18 eagles vs 18 interceptors
50 eagles vs 50 blockade runners
1 sporogenator vs 1 interceptor
-----------------------------------------------------

-----------------------------------------------------
110 blockade runners vs 11 eagles
6 blockade runners vs 1 eagle
1 interceptor intercepts 2 ships
1 interceptor intercepts 1 ship
-----------------------------------------------------

losses:
you :
11 eagles
3 sporators
enemy :
22 interceptors
55 blockade runners
score in this subbattle: 73
<END CUT FROM BR>


we would need the step-by-step thing for each sub-battle.

Battle order you:
ship type 1
ship type 2
ship type 2
ship type 1
ship type 3
etc

Battle order enemy:
ship type B
ship type A
ship type A
ship type B
etc

Enemy goes first
enemy ship type B fires on your ship type 1
your ship type one takes 1LP damage
your ship type 1 inreases the firepower of
etc


This list would be huge, and only accessible by clicking a "more details" button in the detailed BR. It would have to handle sporation, shuffling etc etc, so the battle order and ship list would have to be updated frequently.
On the other hand, we could develop an applet that eats this data and gives us a cool graphical interface running on the _client computer_ (no server load) where we can start the battle, adjust the speed of progress, pause, go step-by-step etc etc.

I think this would be a great improvement, because it would help newbs and people who play with not so deep an interest in the details to understand what really happens in the subattles. For us who have played a while and dug into this stuff it would mean giving up a small bit of our advantage, but it is a small price to pay. Why? Because this kind of cool interface describing battles (we would of course have the actual ST images for each ship, and the ships lined up in their different classes, and cool explosions when they were destroyed etc) will have a magnetic effect on new players. It will also help educating new players so they don't spend all their initial time getting stomped.

We need some stuff to attract new players without changing the essence of the game. I think this idea is good.
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
T2
Admiral
Admiral


Joined: 26 Mar 2005
Posts: 1398
Location: Ontario

 Post Posted: Wed Jan 14, 2009 1:11 am    Post subject:
Reply with quote

The battle reports are not the easist to read sometimes and it can make as many questions as it answers. Not every little event gets recorded there as well just due to the massive size of the computations that happen during a battle.

I think it would be a huge undertaking and then it could take hours to get through the BR of every battle.
Dave and Renee I think looked into as to what really happened in a battle report and the info was just insane to the amount of data processed.

It may even help if the battle reports could be streamlined into some really well thought out and readable summations as to what actually happened during battle could help newer players understand the battles and how they unfold.
 Back to top »
View user's profile Send private message
Senor
Admiral
Admiral


Joined: 12 Nov 2003
Posts: 1114
Location: estonia

 Post Posted: Wed Jan 14, 2009 1:56 am    Post subject:
Reply with quote

the idea has been around for years and has been discussed here. http://www.spacetrace.com/forum/viewtopic.php?t=315&postdays=0&postorder=asc&highlight=battle+reports&start=0

i love the idea of upgrading st graphically and have given it some thought. ideally i would see graphic representations of almost every panel in st. mostly just backgrounds, ie. the construction panel would have a backround showing an inside of a construction yard. and one could also view his fleets graphically (this part should not be too difficult to program. most of the work would be just creating the pictures of ships and backgrounds). and of course it would also be groovy to see graphic representations of battles.
now i dont know anything about coding, but imho it shouldn't be that difficult. i mean you dont have to let the application that makes the animation go through all the data of the battle calculations. all it needs is the summary - what ship destroyed what ship, what ship got shielded, what ship selfdestructed etc.

i'm putting two hands up for a graphic upgrade. and i'm willing to help out creating the graphics for it. but i need to know that someone is willing and able to code it all together. because it will be a time consuming process of creating the artwork.

its a hard fact that spacetrace needs something to change in order to attract the youtube generation who has an attention span of 10 seconds.
or in 2 years there's going to be just 50 players, all vets.
 Back to top »
View user's profile Send private message MSN Messenger
Torin
Ensign
Ensign


Joined: 14 Jan 2009
Posts: 7

 Post Posted: Wed Jan 14, 2009 3:40 am    Post subject:
Reply with quote

this sounds like a great idea but im sure it will take alot of time to create all the necessary technical applications(which i know nothing of)
but it would be a great new thing to make this game more interesting
 Back to top »
View user's profile Send private message
Torin
Ensign
Ensign


Joined: 14 Jan 2009
Posts: 7

 Post Posted: Wed Jan 14, 2009 3:43 am    Post subject:
Reply with quote

T2 wrote:
The battle reports are not the easist to read sometimes and it can make as many questions as it answers. Not every little event gets recorded there as well just due to the massive size of the computations that happen during a battle.

I think it would be a huge undertaking and then it could take hours to get through the BR of every battle.
Dave and Renee I think looked into as to what really happened in a battle report and the info was just insane to the amount of data processed.

It may even help if the battle reports could be streamlined into some really well thought out and readable summations as to what actually happened during battle could help newer players understand the battles and how they unfold.


im fairly new to this game and i agree that the BR are hard to read the way they are currently organized, but i think if we can actually see the battle we wouldnt need to rely on the BR so much because we could see what ships destroyed what and see all the sub battles
it would make things easier for us the users of ST
but not necesarilly for the programmers.
 Back to top »
View user's profile Send private message
Jack09
Vice Admiral
Vice Admiral


Joined: 28 Dec 2008
Posts: 504
Location: United States

 Post Posted: Wed Jan 14, 2009 7:13 am    Post subject:
Reply with quote

Well if we saw the battle, all you would see is a bunch of stuff blowing up, debris going everywhere and chaos, you wouldnt be able to see what ship did better against that ship, unless it went one at a time, like this ship v that ship, see what happens then over and over again, but that would take forever.
_________________
11/11/11
 Back to top »
View user's profile Send private message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Wed Jan 14, 2009 11:05 am    Post subject:
Reply with quote

OK;

I can write a logic diagram or flow chart or something, as a specification, but as far as I can see the raw data was never present for development?

It was still the grouped thing for the subbattles
you:
X interceptors
Y fighters
Z commando fighters
enemy:
U blockade runners
V Bulk fighters
W EMP fighters

X interceptors intercept A ships

etc etc


I need either raw data or the BNF notation for raw data, or something like that. Then I can do a coding spec.
I mean, how difficult can it be?
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
Senor
Admiral
Admiral


Joined: 12 Nov 2003
Posts: 1114
Location: estonia

 Post Posted: Wed Jan 14, 2009 11:13 am    Post subject:
Reply with quote

maybe these can help you

http://www.spacetrace.org/javascripts/

also check this out

http://forum.spacetrace.com/viewtopic.php?topic=340&forum=11
 Back to top »
View user's profile Send private message MSN Messenger
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Wed Jan 14, 2009 2:07 pm    Post subject:
Reply with quote

Yes, I have checked the battlereport javascript.
It generates the grouped thing


I think we can do a nice graphic in the grouped form, but the step-by-step thing (ship-by-ship) would be best.
For instance: Why did I lose my sporators in the example I posted in this thread.
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
Jack09
Vice Admiral
Vice Admiral


Joined: 28 Dec 2008
Posts: 504
Location: United States

 Post Posted: Wed Jan 14, 2009 4:43 pm    Post subject:
Reply with quote

Well they fought against a interceptor. and its especially designed to wipe out c1 ships which the sporator is, and since the sporator has 0 ap, it just got destroyed
_________________
11/11/11
 Back to top »
View user's profile Send private message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Wed Jan 14, 2009 10:53 pm    Post subject:
Reply with quote

yes, that is a distinct possibility, since the report states that some shipd were intercepted.
My point is that given a step-by-step report it would become obvious, no?

Anyway, this is an interesting possibility.
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Thu Jan 15, 2009 10:30 pm    Post subject:
Reply with quote

I'm bumping this up, since admin has now made a well-applauded appearance


Is there any way to feed data to a file directly from the battle-engine, something so that its syntax/format could be described in a formal way, like BNF notation (http://www.cui.unige.ch/db-research/Enseignement/analyseinfo/AboutBNF.html) or something similar?

Then, given just the description, it would be possible to do some preliminary development work. Unless the syntax changed a lot it would be possible to adapt later to any late changes.


As far as I can understand, the battle engine works something like this:

- It is determined that Fleet A should fight Fleet B (no BP, attitude check, alliance check etc)
- Fleets A and B are "lined up" against each other, in classes
DEFINE function fight(Aclass, Bclass):
If not FleetA(Aclass)=empty then
if not FleetB(Bclass)=empty and hasfought(Aclass, Bclass)=false then
resolve(Aclass, Bclass)
hasfought(Aclass,Bclass)=true
else
if Bclass<4 then fight(Aclass,Bclass+1)
endif
else
if Aclass<4 then fight(Aclass+1, Bclass)
endif
ENDDEFINE
fight(1,1)
fight(2,2)
fight(3,3)
fight(4,4)

Something like that.
This is what we see in the BRs as it is now.
I'm looking for the details in the "resolve" function
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
RenéeAB
2nd Rear Admiral
2nd Rear Admiral


Joined: 09 Dec 2007
Posts: 178
Location: Palo Alto, California

 Post Posted: Fri Jan 16, 2009 5:20 pm    Post subject:
Reply with quote

I would recommend parsing the battle engine output for the alog. to run your client end graphics as it seems to be the easier method to use.
And run this only when user checks the actual br.
The "resolve" function is probably a series of boolean checks (for the presence of classes, unexpired conflict timers, and etc. in all fleets present)
_________________
"Hello, my friends, are you visible today? I never knew it could be so strange......shouldn't talk about the weather....shouldn't talk about the government...."

REM - Pop Song 89
 Back to top »
View user's profile Send private message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Fri Jan 16, 2009 8:43 pm    Post subject:
Reply with quote

Agree.

Problem is that I don't know the format of the step-by-step output from the engine.

I was thinking that the imaginary "fight" function/procedure is run when it has already been decided that FleetA and FleetB should fight. It then calls on the imaginary "resolve" function/procedure to resolve all the subbattles, one by one.
I have been very vague, and mixed local and global variables in my psuedo-code, but that was what I was thinking.
I guess in reality it might all be a giant spaghetti-function, or a beatifully partitioned piece of code. No idea whatsoever However, the standard BR just outputs the subbattle results, with the individual events grouped in a red and a blue box showing what the enemy ships did and what my ships did, with no consideration to which order things happened in, which ships were targeted, if shuffling occurred, etc etc. I want that info
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
admin
Board Admin
Board Admin


Joined: 09 Jan 2002
Posts: 2938

 Post Posted: Thu Jan 22, 2009 2:49 pm    Post subject:
Reply with quote

if you use in http://www.spacetrace.org/javascripts/ the script battlereport.js :
Captain Starlight wrote:
From the source code battlereport.js
Quote:
var coordslayer;
var selgo=0;

//////////////////////////////////////////////////////////////////
// here you can set the link to your visualisationscript (locallink)
//
// for example:
var locallink="http://spacetrace.org/battlevisualization/index.php";
//
// the sourcecode of the battlereport will be sent to this specified script
// you can program for example a php-script, that cuts out the right pieces
// of the bat



Where exactly is here??? In the brackets saying (local link)


if you want to program your own battlevisualisytion, you have to change the example link.

the link
http://spacetrace.org/battlevisualization/index.php
goes to yaour example script, which looks like this:
Code:
<?
#header("Content-Type: application/octetstream");
#header('Content-Disposition: inline; filename="battle.txt"');
preg_match("/<battlereport\>(.*?)<\/battlereport>/si", stripslashes($source), $r);
$out="".preg_replace('/<A title="next subbatle.*?\^<\/A>/', "", strip_tags(str_replace("&nbsp;", " ", str_replace("<br>", "\n", str_replace("<BR>", "\n", $r[1]))),"<a><hr>"))."";
$out=preg_replace("/\(\d+\/\d+, \d+ MP\)/", "", $out);
$out=preg_replace("/ +/", " ", $out);
$out=preg_replace("/[\n\r]+[\n\r]+/", "\n\n", $out);
$out=preg_replace('/<A onclick.*?techname=.*?&amp;#id(\d+?)" .*?<\/A>/', "~~~\\1", $out);
$p=preg_split("/<HR.*?>/", $out);
$summary=$p[sizeof($p)-1];
$begin=preg_split("/[\r\n][\r\n]/", $p[0]);
echo str_replace("<pre><A name=p0></A>", "", preg_replace("/[\r\n]+/", ";", $begin[0]));
$i=0;
foreach($begin as $b) if ($i++>0){
   #echo $b;
   preg_match_all("/\b(\d+) ~~~(\d+)\b.*?/m", $b,$ships);
   #var_dump($ships);
   echo "\n";
   foreach($ships[1] as $k=>$v){
      echo $v.";".$ships[2][$k].";";
   }
}   
 // subbattles
for ($i=1; $i<sizeof($p)-1; $i++){
   // these are all subbattles
   /*
   your class 1 vs enemy class 1:
   you:
   1 x id 1
   2061 x id 128
   enemy:
   1000 x id 1
   
   1000 blockade runners vs 1000 fighters
   
   998 fighters vs 499 blockade runners
   1 fighter vs 1 blockade runner
   
   losses:
   you :
   499 blockade runners
   enemy :
   1000 fighters
   score in this subbattle: 2
   #*/
   preg_match_all("/(your|enemy) class (\d+) vs (your|enemy) class (\d+)/m", $p[$i], $classes);
   echo $classes[0][0].";\n";
   preg_match_all("/(you|enemy)\:.+?(.+?).+?(you|enemy)\:.+?(.+?)/m", $p[$i], $w);
   #var_dump($w);
   echo $p[$i];
}

?></pre>
 Back to top »
View user's profile Send private message
colinthecorgi
1st Rear Admiral
1st Rear Admiral


Joined: 30 Nov 2007
Posts: 273

 Post Posted: Thu Jan 22, 2009 3:04 pm    Post subject:

Thx;

I'll just write an echo script then, which can dump the entire raw BR right onto to screen or file, so I can have a look-see
_________________
Running the P since 2007
 Back to top »
View user's profile Send private message
Display posts from previous:   
SpaceTrace Forum Forum Index » Suggestions » Battle graphics
Post new topic   Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Solaris phpBB theme/template by Jakob Persson
Copyright © Jakob Persson 2003



Powered by phpBB © 2001, 2002 phpBB Group

Impressum