The forum is a place to speak about our games, make suggestions, report bugs, and so on. To post a message, you need to be logged in.

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2065, 3150d 7h ago.
Hi everyone,

I believe mentioned a few days ago that I'd written some code that duplicates some of the game logic from Void Patrol. Seeing how my smart missile thread is getting more attention, I thought I'd share it with you, so you can try those missiles out.

My project is named (for the moment) "Void-Patrol-Clone" and it's hosted at the website GitHub.com. You can visit the project page at: http://blckknght.github.com/Void-Patrol-Clone/

Here's the contents of the README file for the project (sorry about the double spacing forced by the forum):

Void Patrol Clone


This is a project to replicate some of the elements of the game
Space Wing: Void Patrol from takeAplay.net (http://www.takaplay.net)
in a stand alone program. The program can be used to learn better
piloting skills and to test out game ideas, but at this time is is not
a game that it is much fun to play.

This Project is Copyright 2008-2010 Steven Barker (BlckKnght@gmail.com).
It may be used, modified and/or redistributed under the terms of the MIT
License, see the COPYRIGHT file or the following web site for details:
http://www.opensource.org/licenses/mit-license.php

The project was inspired by Space Wing: Void Patrol which is Copyright
takAplay.net (webmaster@takeaplay.net), but no code or art from that
game has been used.


Dependencies

This project is written in Python. To run it you will need a copy
of the Python interpreter which can be downloaded for most operating
systems from the Python website (http://www.python.org/download).
Currently a 2.x version of Python is required, but support for 3.x
versions is planned for the near future.

The game also requires a version of the Pygame library that is
compatible with your version of Python. Pygame can be downloaded
from the Pygame website (http://pygame.org/download.shtml).


How to Play

Run the program by executing the file "vp.py". You'll see a hex grid
displayed on the screen, with your ship located in the center (shown by
a triangle). All of the locations you can move to will have one or more
angled lines drawn on them, showing the possible facings your ship can
reach. When you ship has gained some speed, you'll also see the potential
locations you'll be able to go to on the following turn (in a lighter color).

Your ship can be controlled by pressing keys on the keyboard using either
of two systems:

First, the keyboard shortcuts used on the regular Void Patrol site will work:

U I O
(thrust forwards+left) (boost forwards) (thrust forwards+right)

J K L
(turn left) (thrust forwards) (turn right)

X Enter
(cancel orders) (advance to next turn)


Alternatively, a similar scheme using the keyboard number pad can be used
(but notice that the keys for boosts and forwards thrusts are swapped).

NP7 NP8 NP9
(thrust forwards+left) (thrust forwards) (thrust forwards+right)

NP4 NP5 NP6
(turn left) (boost forwards) (turn right)

NP0 NPEnter
(cancel orders) (advance to next turn)


Several of the function keys on the keyboard can be used to trigger
special functions:

F1 - Switch to a Badger-like fighter with maneuvering code 4S1(3)
F2 - Switch to a Javelin-like fighter with maneuvering code 6S2(4)
F3 - Switch to a Sparrowhawk-like fighter with maneuvering code 4D1(3)
F4 - Switch to a Lone Wolf-like fighter with maneuvering code 5D2(4)

F5 - Launch a 5 thrust "smart" missile
F6 - Launch a 6 thrust "smart" missile

All of the fighter switching commands will move the ship back to the
starting position at the center of the screen. Missiles will also appear
there, and will seek on the player's ship until they hit it.

Missiles will be drawn with their starting and ending velocities shown by
extra lines on the hex map, as this makes it easier to see how they are
attempting an intercept.


To Do

This program is a work in progress. Feedback is appreciated!

Here are some of the things planned for improving the game:

Allow both berserk and "smart" missiles to be launched at the same time
(currently the choice of which type is hard coded).

Make it possible to move the viewport so that the fighter and missiles
are always on the screen.

Clean up the simulation code. It's really ugly.

Move most of the python files into a package so the main directory
is cleaner.

Port to Python 3.x. Pygame recently released a 3.x version, but it may
not be complete yet. See if we use anything that is missing (unlikely).

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2072, 3145d 8h ago. In reply to message 2065.
Has anyone tried this out yet?

I've been making various updates to the code, and a lot of the stuff listed above in the TODO section is now finished. You can get the latest version at the address I gave above: http://blckknght.github.com/Void-Patrol-Clone

If you're interested in my updates, you can see the details on the GitHub project page at this slightly different address: http://github.com/BlckKnght/Void-Patrol-Clone

derekticus

is Derek

(ice user)
"are you human, or are you fascist?"
Lives in Seattle, Washington, USA
Last login: 2245d 6h
Last forum reset: 2270d 14h
Membership: 3699d 13h

Void Patrol Clone - a program for playing with the VP rules

Message 2073, 3145d 3h ago. In reply to message 2072.
BlckKnght wrote:
Has anyone tried this out yet?

I've been making various updates to the code, and a lot of the stuff listed above in the TODO section is now finished. You can get the latest version at the address I gave above: http://blckknght.github.com/Void-Patrol-Clone

If you're interested in my updates, you can see the details on the GitHub project page at this slightly different address: http://github.com/BlckKnght/Void-Patrol-Clone


Very cool, BlckKnght!
I probably won't get a chance to try it out due to the time pressures of life, but it sounds excellent.

AshayRey

is a VP addict

(ice user)
"Please don't move if i shoot at you"
Lives in my cockpit
Last login: 2044d 20h
Last forum reset: 2167d 18h
Membership: 3415d 13h

Void Patrol Clone - a program for playing with the VP rules

Message 2074, 3145d 2h ago. In reply to message 2073.
BlckKnght wrote:
Has anyone tried this out yet?

I've been making various updates to the code, and a lot of the stuff listed above in the TODO section is now finished. You can get the latest version at the address I gave above: http://blckknght.github.com/Void-Patrol-Clone

If you're interested in my updates, you can see the details on the GitHub project page at this slightly different address: http://github.com/BlckKnght/Void-Patrol-Clone


Although i find it very atempting to try it i probaly won't do it because i have to install phyton and adding another layer to my machine. I am always very hesitating to do so because it's a developers machine that i need to keep in good working shape. So sorry, no.

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2075, 3145d 1h ago. In reply to message 2073.
derekticus wrote:
Very cool, BlckKnght!
I probably won't get a chance to try it out due to the time pressures of life, but it sounds excellent.

I've been thinking about where I want to go with my application, and whether or not I want to actually turn it into a real game or not. If I do, I will want to come up with some different rules than what are used in VP, both for copyright reasons and because I don't want to simply rip off Neko's game. I might try to make a very missile-centric game, where the challenge is not lining up shots on the enemy with your guns, but getting your Point Defense batteries facing towards a wave of incoming missiles. ECM and ECCM would get to play a part too, so you might succeed in getting your missiles to hit their target only to discover that the enemy had you fooled and that they'd hit a decoy.

neko

is mostly harmless

(schizo superuser)
"we apologise for the inconvenience"
Lives on deep thought
Last login: 81d 11h
Last forum reset: 355d 12h
Membership: never

Void Patrol Clone - a program for playing with the VP rules

Message 2076, 3145d ago. In reply to message 2065.
Hey! I am flattered you like the game so much you've decided to start working on your own version. Will it be multiplayer?

Hollander


(steel user)
"Fortune favors the bold."
Last login: 910d 12h
Last forum reset: 2455d 16h
Membership: 4877d 14h

Void Patrol Clone - a program for playing with the VP rules

Message 2078, 3144d 17h ago. In reply to message 2075.
Sounds like a plan to me.

Hollander


(steel user)
"Fortune favors the bold."
Last login: 910d 12h
Last forum reset: 2455d 16h
Membership: 4877d 14h

Void Patrol Clone - a program for playing with the VP rules

Message 2079, 3144d 16h ago. In reply to message 2076.
neko wrote:
Hey! I am flattered you like the game so much you've decided to start working on your own version. Will it be multiplayer?


Hi Neko. I'd rather see you implement some of these ideas. But I know you're probably short on time. maybe it's time for Blcknght to take over the programming part? Your brainchild seems eager to grow and expand on it's own

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2081, 3144d 11h ago. In reply to message 2076.
neko wrote:
Hey! I am flattered you like the game so much you've decided to start working on your own version. Will it be multiplayer?

Yep, I really do like Void Patrol. There are not a lot of games that feature inertial movement, and VP's Supply and Demand component pricing scheme makes it so that fighter design always requires some creativity.

As for adding multiplayer to my program, I'd love to do it, but I've not given such a design much thought yet. I'm not much of a web programmer, but perhaps this will be the thing to get me to learn more. Alternatively, some of the code I wrote when I first started my program was focused on enhancing player's abilities to pick good moves (by showing all available moves), and perhaps with some work it could become a probabilistic AI.

Anyway, I'm glad to see you around, Neko! I was worried you might be gone for good.

If you do more development work on VP, please feel free to use anything you'd like from my project (my Python code probably won't help you much with your PHP codebase, but the underlying algorithms shouldn't be too hard to understand). My project is released under the MIT license, meaning (very roughly) that anyone can do pretty much anything they want with it as long as I'm not liable for the result.

The most interesting part of my code is probably the HexVec class (in the file vpmath.py) which implements a "projected 3d isometric" coordinate system. That system exploits the fact that the outlines of a cube viewed corner-on in an isometric projection turns out to be a hexagon (for example, look at the cubes that make up the board for the classic game Q*bert: http://upload.wikimedia.org/wikipedia/en/5/5e/Qbert.png). The projected 3d isometric coordinate system assigns 3d coordinates to each hex, with the constraint that x+y+z=0. The constraint allows you to drop one of the coordinates if you want and recalculate it later (z = -(x+y)). Here's a quick image showing how the coordinates compares with more common Cartesian ones:

http://i476.photobucket.com/albums/rr128/BlckKnght/hexcoordinates.png

When using these coordinates, the hex distance of a vector (x, y, z) turns out to be one line of code: max(|x|, |y|, |z|) or equivalently (|x|+|y|+|z|)/2 (where |x| means the absolute value of x).

Finding the hex-aligned components of an vector (x, y, z) only requires about ten or twelve lines of code (depending on how bulky control logic is in your programming language of choice):

(-y, y, 0) and (-z, 0, z) if |x| is greater than or equal to both |y| and |z|,
(x, -x, 0) and (0, -z, z) if |y| is greater than or equal to both |x| and |z|,
or
(x, 0, -x) and (0, y, -y) the rest of the time (when |z| is greater than both |x| and |y|).

My components() method is a bit more complicated only because of how I describe directions. Because those two operations are so easy, the missile seeking code in my program became really simple.

derekticus

is Derek

(ice user)
"are you human, or are you fascist?"
Lives in Seattle, Washington, USA
Last login: 2245d 6h
Last forum reset: 2270d 14h
Membership: 3699d 13h

Void Patrol Clone - a program for playing with the VP rules

Message 2083, 3143d 14h ago. In reply to message 2075.
BlckKnght wrote:
derekticus wrote:
Very cool, BlckKnght!
I probably won't get a chance to try it out due to the time pressures of life, but it sounds excellent.

I've been thinking about where I want to go with my application, and whether or not I want to actually turn it into a real game or not. If I do, I will want to come up with some different rules than what are used in VP, both for copyright reasons and because I don't want to simply rip off Neko's game. I might try to make a very missile-centric game, where the challenge is not lining up shots on the enemy with your guns, but getting your Point Defense batteries facing towards a wave of incoming missiles. ECM and ECCM would get to play a part too, so you might succeed in getting your missiles to hit their target only to discover that the enemy had you fooled and that they'd hit a decoy.


So emphasis on defense! I like the concept. There will need to be some type of other attack weaponry, otherwise will you win by default when the opponent is out of missiles and you still are alive?

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2084, 3143d 14h ago. In reply to message 2083.
derekticus wrote:
So emphasis on defense! I like the concept. There will need to be some type of other attack weaponry, otherwise will you win by default when the opponent is out of missiles and you still are alive?

Well, probably I'd need to change the nature of missile weapons to get there. Rather than being one-shot weapons, the missile launcher components could have an ammo count telling you how many missiles of a given type you have left. Similarly, the current VP rule limiting you to just one missile launch per turn might change, so you could fire off a volley of several at once.

None of this is set in stone though. I've not thoroughly explored the design options.

sfatula

is Male

(jungle user)
Lives McKinney, Texas
Last login: 2171d 8h
Last forum reset: never
Membership: 3702d 2h

Void Patrol Clone - a program for playing with the VP rules

Message 2209, 2781d 3h ago. In reply to message 2084.
Been sick, as you may know, but, finally got around to loading this on Mac OSX. Works fine of course. Very helpful. Do you still plan on moving ahead with development?

BlckKnght


(killer user)
Last login: 10d 13h
Last forum reset: 98d 14h
Membership: 4365d 23h

Void Patrol Clone - a program for playing with the VP rules

Message 2210, 2780d 23h ago. In reply to message 2209.
sfatula wrote:
Been sick, as you may know, but, finally got around to loading this on Mac OSX. Works fine of course. Very helpful. Do you still plan on moving ahead with development?

I'm glad it worked on another platform, though being written in python it should work just about anywhere. If you grabbed the latest version be to you read the updated README, as I made several changes after posting the copy above.

I haven't done work on this project for many months now though. I put some effort into an aborted attempt to make a web UI for it using the Pyglet compiler which compiles Python code to JavaScript, but my web-layout skills are seriously lacking. I've recently been learning ActionScript (the language underlying Flash apps), so perhaps I should see if that would let me whip up a UI that I'd be happy with.

Hmmm...

sfatula

is Male

(jungle user)
Lives McKinney, Texas
Last login: 2171d 8h
Last forum reset: never
Membership: 3702d 2h

Void Patrol Clone - a program for playing with the VP rules

Message 2211, 2779d 11h ago. In reply to message 2210.
I did grab the latest. Yep, should work on any python platform. python is a slight pain for folks since on many machines, it's not there by default, though it is on Mac. However, the py-game portion is not there by default on Mac.

I don't know anything about displaying such things on a web screen, other than text type pages. That's all I ever work with. So, I am no help!

Copyright

It is understood that in submitting material (like suggestions, comments and proposals on our games) on this forum you are giving up any copyright claims, allowing us at takeaplay.net to freely display, copy, distribute, alter, transform, and build on this material, for the purpose of improving our site and games. We cannot guarantee that all proposals and requests will be developed, of course. In addition, we cannot guarantee that your contribution will be credited esplicitly, though we usually try to do that. However, we intend to keep the forum publicly available, so other players will always be able to know how and when you contributed to this site's growth. It is understood that we will make use of your suggestions to improve the site to the best of our abilities and time available. Your contributions will be rewarded with big smiles, , warm hugs, and no money.