IRCiv: Difference between revisions

From SoylentNews
Jump to navigation Jump to search
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:


[[File:irciv.png|100px|IRCiv logo]]
'''IRCiv''' is a little Civilization-like strategy game under development.


It's run as a script by the exec IRC bot, which usually lurks in the #civ channel on the irc.sylnt.us server. Anyone welcome to come check out progress or have a tinker. Must be registered and identified with NickServ to be an IRCiv player.
[[File:irciv.png|100px|IRCiv logo|right]]


IRCiv is a little game (and game engine of sorts) for building stuff like in "Civilization"-branded games.
[[IRC]] | [[IRC:exec]]


It is run as a script by the exec bot, which usually lurks in the #civ channel on irc.sylnt.us IRC server. Anyone welcome to come check out progress or have a tinker. Must be registered and identified with NickServ to be an IRCiv player.
[[File:irciv_map.png|600px|sample IRCiv map]] [[http://irciv.bot.nu/?pid=3]]
 
 
[[IRC]]
 
[[IRC:exec]]


==Starting a new game==
* ensure game bot is in proposed game channel with /invite or ~join
* gm issues "~civ register-channel" command to generate map for channel
* each player in channel that wishes to join game issues "~civ init" command


==Commands==
==Commands==


IRCiv commands must start with the [[IRC:exec|exec]] alias "civ" unless an alias lock is set (which is the case by default).
IRCiv commands must start with the [[IRC:exec|exec]] alias "~civ" unless an alias lock is set.


===Quick start guide===
===Quick start guide===
Line 22: Line 23:
help or ?
help or ?
</pre>
</pre>
===game-list===
===player-list===


===status===
===status===
Outputs a status message to either PM (default) or the game channel if "public_status" flag is set.
Outputs a status message to either PM (default) or the game channel if "public_status" flag is set.


during testing exec auto sets the public_status flag for every player, but players can unflag it if they want
<pre>
<crutchy> ~civ status
<exec> #civ crutchy => http://irciv.bot.nu/?pid=1
<exec> #civ crutchy => 1/2, warrior, +100, (45,41)
</pre>
 
During testing exec auto sets the public_status flag for every player.
 
Adding a space-delimited x y coordinate after the status command will return the status of that coordinate.
 
<pre>
<crutchy> ~civ status 45 42
<exec> status for coordinate 45,42: occupied by crutchy
<exec> city: fart
<exec> units: 0
</pre>


===flag===
===flag===


syntax: [civ] flag name
syntax: [~civ] flag name


flags recognised:
flags recognised:
Line 36: Line 56:
- public_status
- public_status


<i>outputs player active unit status to game channel instead of private message</i>
<i>outputs player active unit status to game channel instead of private message (ignored during development)</i>


- grid
- grid


<i>paints gridlines on map images</i>
<i>paints gridlines on map images</i>
- coords
<i>paints terrain grid coordinates on map images</i>
- city_names
<i>paints city names under cities using player color on map images</i>
- logging
<i>logs status messages to a file in the irciv data directory</i>
- irc_messages
<i>enables/disables status message output to irc</i>


example:
example:
<pre>
<pre>
flag public_status
~civ flag public_status
</pre>
</pre>


===unflag===
===unflag===
syntax: [civ] unflag name
syntax: [~civ] unflag name


===set===
===set===
syntax: [civ] set key=value
syntax: [~civ] set key=value


===unset===
===unset===
syntax: [civ] unset key
syntax: [~civ] unset key


===Active unit movement===
===Active unit movement===
Line 71: Line 107:
units can't move off map or off landmasses
units can't move off map or off landmasses


 
if "public_status" flag isn't set, it's probably easier to enter movement commands in the exec PM window, though they will still be recognised in the game channel; you will just have to change to PM window to see status
if "public_status" flag isn't set (which is the case by default), it's probably easier to enter movement commands in the exec PM window, though they will still be recognised in the game channel; you will just have to change to PM window to see status


===Building a city===
===Building a city===
Line 81: Line 116:


only settlers can build cities
only settlers can build cities
===Administration commands===
- dev-op
<i>test command for development</i>
- register-channel
- save-data
- load-data
- init-ai
- test-ai
- player-unset
- player-data
- move-unit
- object-edit
- player-edit


==Website==
==Website==


A simple website @ http://irciv.port119.net/ has been set up to access map images output by the IRC script.
A simple website @ http://irciv.bot.nu/ has been set up to access map images output by the IRC script.


A demo can be accessed here: http://irciv.port119.net/?pid=1
A demo can be accessed here: http://irciv.bot.nu/?pid=1


==Development==
==Development==
Line 93: Line 154:


===Development journal entries===
===Development journal entries===
http://soylentnews.org/~crutchy/journal/901
http://soylentnews.org/~crutchy/journal/441
http://soylentnews.org/~crutchy/journal/419
http://soylentnews.org/~crutchy/journal/397


http://soylentnews.org/~crutchy/journal/393
http://soylentnews.org/~crutchy/journal/393
Line 111: Line 180:


==TO DO LIST==
==TO DO LIST==
# implement unit attacking
# unit attacking
# city capturing
# city build queue
# diplomacy
# finances
# tech advancement
# new units


== Development notes ==
== Development notes ==
Line 169: Line 244:


Conf file for each script (optional) contains key=value for lib.php function that sets constants for scripts.
Conf file for each script (optional) contains key=value for lib.php function that sets constants for scripts.
Add bucket index list command.


Add a socket interface for buckets.
Add a socket interface for buckets.


==Terminal output==
[[Category:IRC]]
 
[[Category:IRC:exec]]
Here's a snippet of terminal output from a single IRCiv command. It's not very pretty and should really be tidied up. Some of the output appears red in the terminal.
There's also a bit of junk that happens here because of another script set to execute on every line.
Output from multiple scripts is intermingled because they run concurrently (should probably put a pid prefix or something).
<pre>
:crutchy!~crutchy@709-27-2-01.cust.aussiebb.net PRIVMSG #civ :r
php scripts/irciv.php 'crutchy' 'r' '#civ' '1400751332.253'
BUCKET_GET [IRCiv_#civ_players]: SUCCESS (34kb)
:crutchy NOTICE #civ :~AUJ73HF839CHH2933HRJPA8N2H r
php scripts/irciv.php 'crutchy' '~AUJ73HF839CHH2933HRJPA8N2H r' '#civ' '1400751332.253'
BUCKET_GET [IRCiv_#civ_map_coords]: SUCCESS (8kb)
BUCKET_GET [IRCiv_#civ_map_data]: SUCCESS (0kb)
BUCKET_GET [IRCiv_#civ_players]: SUCCESS (34kb)
BUCKET_GET [IRCiv_#civ_map_coords]: SUCCESS (8kb)
BUCKET_GET [IRCiv_#civ_map_data]: SUCCESS (0kb)
BUCKET_SET [IRCiv_#civ_players]: SUCCESS
process terminated normally
IRCiv: #civ/crutchy => successfully moved warrior right from (85,26) to (86,26)
IRC_MSG IRCiv: #civ/crutchy => successfully moved warrior right from (85,26) to (86,26)
IRCiv: #civ/crutchy => http://irciv.port119.net/?pid=1
IRC_MSG IRCiv: #civ/crutchy => http://irciv.port119.net/?pid=1
IRCiv: #civ/crutchy => 0/2, settler, +100, (88,26)
IRC_MSG IRCiv: #civ/crutchy => 0/2, settler, +100, (88,26)
BUCKET_SET [IRCiv_#civ_players]: SUCCESS
process terminated normally
</pre>

Latest revision as of 12:23, 24 August 2015

IRCiv is a little Civilization-like strategy game under development.

It's run as a script by the exec IRC bot, which usually lurks in the #civ channel on the irc.sylnt.us server. Anyone welcome to come check out progress or have a tinker. Must be registered and identified with NickServ to be an IRCiv player.

IRCiv logo
IRCiv logo

IRC | IRC:exec

sample IRCiv map [[1]]

Starting a new game

  • ensure game bot is in proposed game channel with /invite or ~join
  • gm issues "~civ register-channel" command to generate map for channel
  • each player in channel that wishes to join game issues "~civ init" command

Commands

IRCiv commands must start with the exec alias "~civ" unless an alias lock is set.

Quick start guide

help or ?

game-list

player-list

status

Outputs a status message to either PM (default) or the game channel if "public_status" flag is set.

<crutchy> ~civ status
<exec> #civ crutchy => http://irciv.bot.nu/?pid=1
<exec> #civ crutchy => 1/2, warrior, +100, (45,41)

During testing exec auto sets the public_status flag for every player.

Adding a space-delimited x y coordinate after the status command will return the status of that coordinate.

<crutchy> ~civ status 45 42
<exec> status for coordinate 45,42: occupied by crutchy
<exec> city: fart
<exec> units: 0

flag

syntax: [~civ] flag name

flags recognised:

- public_status

outputs player active unit status to game channel instead of private message (ignored during development)

- grid

paints gridlines on map images

- coords

paints terrain grid coordinates on map images

- city_names

paints city names under cities using player color on map images

- logging

logs status messages to a file in the irciv data directory

- irc_messages

enables/disables status message output to irc

example:

~civ flag public_status

unflag

syntax: [~civ] unflag name

set

syntax: [~civ] set key=value

unset

syntax: [~civ] unset key

Active unit movement

up or u
down or d
left or l
right or r

after movement command, status is automatically shown

if unit successfully moves, the active unit will be cycled to the next available unit

units can't move off map or off landmasses

if "public_status" flag isn't set, it's probably easier to enter movement commands in the exec PM window, though they will still be recognised in the game channel; you will just have to change to PM window to see status

Building a city

build or b

only settlers can build cities

Administration commands

- dev-op

test command for development

- register-channel

- save-data

- load-data

- init-ai

- test-ai

- player-unset

- player-data

- move-unit

- object-edit

- player-edit

Website

A simple website @ http://irciv.bot.nu/ has been set up to access map images output by the IRC script.

A demo can be accessed here: http://irciv.bot.nu/?pid=1

Development

Developer(s): crutchy

Development journal entries

http://soylentnews.org/~crutchy/journal/901

http://soylentnews.org/~crutchy/journal/441

http://soylentnews.org/~crutchy/journal/419

http://soylentnews.org/~crutchy/journal/397

http://soylentnews.org/~crutchy/journal/393

http://soylentnews.org/~crutchy/journal/386

http://soylentnews.org/~crutchy/journal/381

http://soylentnews.org/~crutchy/journal/379

http://soylentnews.org/~crutchy/journal/367

http://soylentnews.org/~crutchy/journal/357

http://soylentnews.org/~crutchy/journal/355

http://soylentnews.org/~crutchy/journal/352

TO DO LIST

  1. unit attacking
  2. city capturing
  3. city build queue
  4. diplomacy
  5. finances
  6. tech advancement
  7. new units

Development notes

Have a "set color = R,G,B" setting, and publicly announce if a player changes color.

Paint health bars above unit shields like civ2.

Create attack_strength and defense_strength unit properties (for air,sea and land).

If a unit moves into same coord as foreign unit and attack_strength > 0, initiate attack.

Alliance settings? (use account name instead of nick)

Don't allow player to move any unit with attack_strength of zero onto same coord as foreign unit/city.

Attacking: for both units, health (0-100) = health - rand(attack/2,attack) + rand(defense/2,defense) The defense rand must be no greater than the attack rand. Modify attack/defense with terrain bonuses (as applicable).

Map image filenames to be stored in bucket for each game/player (separate from player data bucket as doesn't need to be loaded each execute). Bucket index: "irciv_webmaps_%%game_id%%_%%player_id%%"

Improve map output - include flags for various features: units, cities, fog, etc

Goto command, using migrated delphi pathfinding algorithm.

Territory: fixed radius around cities and coords occupied for certain time.

Player negotiation/interaction/diplomacy.

Tech advancement

Finance/tax

More units/city improvements

Documentation

Website

Limit map file uploads to IP address (security by obscurity).

Floating absolute positioned box in top left corner with mouse click data (scrollable?). Highlighted map tile selection image (floating, absolute). Use js (refer to old civ code) to show coordinates on mousemove, and tile info on mouseclick. Put logo in floating div in top left corner (above data div). No margins/padding around map image.

TODO: Delphi IRCiv client

Develop a client using Delphi that downloads map, communicates with exec using GUI controls and allows player to chat with other players (include IRC client features). Make a web server query (to be polled by delphi client) that returns the name of the latest map file, which contains a timestamp so that the client can determine if a new map needs to be downloaded. This is to account for actions by other players. When the local player takes an action, download a new map.

Exec notes

Conf file for each script (optional) contains key=value for lib.php function that sets constants for scripts.

Add a socket interface for buckets.