Author Topic: Lunar/Martian Rover Tank battle  (Read 17209 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Lunar/Martian Rover Tank battle
« on: March 27, 2007 »
Another project I'll start (but probably not finish) is an online version of the tank portion of Atari Combat on the 2600.

Players get to build a tank, and then program it every 20 seconds during a battle.
It will be turn based, but it's going to be great!
You are our 9001st visitor.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Lunar/Martian Rover Tank battle
« Reply #1 on: March 27, 2007 »
What are you going to write this in CK? I remember the original, it was good fun :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lunar/Martian Rover Tank battle
« Reply #2 on: March 28, 2007 »
And, try to keep it simple but try to finish your project. There is a vast difference
between starting a project and finishing it ( I guess you know ). But finishing a
project is really satisfying ... so I would keep the outline of the game in the be-
ginning as small as possible so that it gets easier to achieve that ...

Anyway, good luck with it ...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #3 on: March 28, 2007 »
It will be a mix of PHP, MYSQL and JavaScript.

Getting the JavaScript to work exactly the same on different platforms (as it calculates the velocity/position of everything on each user's machine independantly, so a difference of 0.000001 could mean the difference between a collision being detected or not on one machine, and not on another during the same battle) is going to be the most tricky problem.

I could assign one client as the master, which would send the results of all of the calculations to the server, which then pushes them out to the other clients.

The gameplay will revolve around sending a series of commands to the tank, for example
f10;r+45;s1;
could mean
Foreward for ten seconds; Rotate 45 degrees clockwise; Shoot weapon one;

besides the basic battles, there could be flag capture, tank football, etc, but I'll get the basic game working first.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Lunar/Martian Rover Tank battle
« Reply #4 on: March 28, 2007 »
I never played the original but it sounds like a good idea, as Benny said keep it simple, at least at fires so it gets done. I know the feeling of having many unfinished projects :)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lunar/Martian Rover Tank battle
« Reply #5 on: March 28, 2007 »
@combatking0:

Didn't know the original game either. Nevertheless, it sounds very interesting.

About the JavaScript part working the same on different platforms I am a bit
confused. Don't have any information that there exists differences. Do you
have any certain information about this ?

Nevertheless, I am of course willing to help / test the scripts on my platform
for testing reasons.

Keep us informed how the game evolves ...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
Re: Lunar/Martian Rover Tank battle
« Reply #6 on: March 29, 2007 »
Sounds Nice!

Good luck with it all. If you need testing, you know where the crew are to do it for you!!! hahaha.
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #7 on: April 02, 2007 »
@benny

Unfortunately different browsers handle JS slightly differently.

I'd like to see how different the results would be for users of Windows:MSIE, Windows:FireFox, Mac:MSIE and Mac:Safari

I'll try to avoid mobile platforms, as the game will require a "large" minimum screen resolution of at least 640 by 512 pixles.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Movement Test
« Reply #8 on: April 03, 2007 »
The following will test the tank game movement system.

Please may users of non Windows XP with MSIE 6 test this on their browsers and see what happens.
Simply unzip it, open the index.htm file, and click on the tank.

I have the facilities to test it under WinXP+MSIE 6, WinXP+MSIE 7, WinXP+FireFox, MacOSX+Safari and MacOSX+MSIE (not sure of the version on the Mac browsers).

Please reply with any error messages you get.

[edit]
I have added the first of the command features to the game - I'll post the new version shortly
[/edit]
« Last Edit: April 03, 2007 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lunar/Martian Rover Tank battle
« Reply #9 on: April 03, 2007 »
Sorry. I am with XP, too ... cant help here!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #10 on: April 03, 2007 »
Tests complete:
WinXP+MSIE6 - working
WinXP+FireFox - working
MacOSX10.4+Safari - working

Tests not performed:
WinXP+MSIE7
Any other combination of OS and browser version not listed above

It turns out that MSIE is no longer available for Mac OS, so I won't be supporting it.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Lunar/Martian Rover Tank battle
« Reply #11 on: April 03, 2007 »
Works on win 2000 with
firefox 2.0.0.3
opera 9.02
and internet explorer 9.0.2600.0000IS
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #12 on: April 03, 2007 »
Thanks for testing everyone.

I have made a few changes, and now it supports foreward movement and rotation.

To make the tank move, type f followed by the number of seconds you want it to move.
To make it rotate, type r followed by the number of degrees you want it to rotate by (limited to between -180 and 180).

You may type in multiple commands if you seperate them with a ; symbol.
DO NOT USE SPACES as JavaScript appears to lack the trim command, so I'll work that one out when it comes to using PHP with it.

example:
r-20;f3;r50;f2

All other commands will be ignored. All commands are case sensitive, so F5 won't work, but f5 will.

Once you have typed in your commands, click on the Transmit button.
Transmission will be automatic in the final version - you'll see a countdown instead of this.
I have a feeling tha tanks will be smaller too.
« Last Edit: February 08, 2008 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #13 on: April 04, 2007 »
I have just tested the new version on Safari, and there's a minor display problem.
Other than that, it's still OK.
You are our 9001st visitor.
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lunar/Martian Rover Tank battle
« Reply #14 on: April 04, 2007 »
That sounds good, CombatKing0.

I think I got the idea now of this game - I am really looking forward to see it
in action and to play it live versus some other player via the internet !!!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Lunar/Martian Rover Tank battle
« Reply #15 on: April 04, 2007 »
That we will be able to play against each other makes this cool.
It works well here btw.. Only suggestion I'd make is that I don't really like the clunky rotations of the sprite. a 2D vector would be much better, the forumla is easy.


XR = COS (THETA) * X1 - SIN (THETA) * Y1
YR = COS (THETA) * Y1 + SIN (THETA) * X1
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lunar/Martian Rover Tank battle
« Reply #16 on: April 04, 2007 »
@SW:

Hmm ... drawing lines with JavaScript is not that easy IMHO. At least it is
not supported natively in JS. Hmm ... SVG or the following libs would come
to my mind :

http://www.c-point.com/javascript_vector_draw.htm

http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #17 on: April 04, 2007 »
PHP supports drawing lines and other stuff, so in theory, I could run a load of images of tanks off (180 of them all facing different directions) using a PHP batch process.
Because the results will be GIFs, the total of up to 1440 images between 8 players shouldn't take too long to preload.

The images in use currently have been drawn in a graphic editor program.

I'll have to find a more reliable host for it first, but I could run the test versions from right here at work.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Lunar/Martian Rover Tank battle
« Reply #18 on: April 06, 2007 »
Cool. The tanks would look much better smoothly rotating, it will fit in perfectly with the smooth movement of the tanks.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Lunar/Martian Rover Tank battle
« Reply #19 on: April 10, 2007 »
I have had a go, but the first tank drawn is visible under the second tank, and the first two under the third, etc.

I'll have to find a way to blank the image each time a new tank is drawn.
You are our 9001st visitor.
Challenge Trophies Won: