Page 1 of 4

LoveWars prototype/demo

Posted: Thu Sep 30, 2010 10:27 am
by bartoleo
I'm working on a Strategic Turn-based Game like Advance Wars
I'm using a project structure similar to fistfulofbeef (thank you LÖVE-Party Copyright (c) 2010)

Map is random
You can drag the map (left button), zoom (mouse wheel) and select cells
I'm looking for a tileset (now I use the one used in the tileset example)
My goal is:
implementing loading maps from file (I looked Tiled ... but... format file is not so 'easy')
implementing battles with 2 human players (initially on same pc, next via network)
implementing AI cpu for human vs CPU ... for this I think i could use Lua ;)

feel free to say anything... feel free to contribute... no problem
lovewars.JPG
lovewars.JPG (100.36 KiB) Viewed 9749 times
Bitbucket project:
https://bitbucket.org/bartoleo/lovewars/overview

actual download
https://bitbucket.org/bartoleo/lovewars ... ewars.love (actually broken, for some reason my files uploaded are not visible... or bitbucket not accepting .love extension... why?)
https://bitbucket.org/bartoleo/lovewars ... s.love.zip rename it to lovewars.love (broken too... now doesn't accepts zip...)

lovewars.love attachement updated 20 oct 2010

Re: LoveWars prototype/demo

Posted: Thu Sep 30, 2010 1:07 pm
by TechnoCat
I love Days of Ruin for DS. Looking forward to seeing the completion of this.

Re: LoveWars prototype/demo

Posted: Thu Sep 30, 2010 2:46 pm
by bartbes
Cool, I'm looking forward to an Advance Wars inspired game!

Re: LoveWars prototype/demo

Posted: Fri Oct 01, 2010 4:13 pm
by spirulence
(shameless plug)

If you're looking for some place to start from when loading maps and tilesets, you can use some code that I devised for this purpose for a 2D platformer I'm making.

The level files live in a directory called "levels" and have an extension of ".level". Use level.lua to load them. They are objects: call "level.load" to create one and ":draw()" on the returned object to draw it to the screen.
The level files look like this:

Code: Select all

local _ = 0
local level = {
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1, 1, 1, 1,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1, 1, 1, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, 1, 1, 1, 1, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, 1, 1, 1, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, _, 2, 1, 1, 3, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, _, _, _, _, _, _, 2, 1, 1, 1, 1, _, _, _, _, _, _, _, _,},
	{_, _, _, _, _, 1, _, _, _, _, 2, 1, 1, 1, 1, 1, 1, _, _, _, _, _, _, _,},
	{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
}

level.tileset = "basic1"

return level
Tilesets are made up of a tileset file and an image, specified in the tileset file. I put them in a directory named "tilesets" and always give them the extension ".tileset" to set them apart. The tileset is loaded automatically with the level, using loadtileset.lua.
The tileset files look like this:

Code: Select all

local tileset = {
	size = 50,
	margin = 2,
	image = loadImage("tilesets/basic1.png"),
}

return tileset
I've written a little more about the approach at my blog: http://spirulence.tumblr.com/post/11706 ... and-levels http://spirulence.tumblr.com/post/11706 ... 1-in-depth


Hope some of this is useful!

Re: LoveWars prototype/demo

Posted: Fri Oct 01, 2010 4:26 pm
by bartoleo
thank you for info & code
what I'm missing now is a AdvanceWars (or similar) tileset

Re: LoveWars prototype/demo

Posted: Fri Oct 01, 2010 7:40 pm
by nevon
Get hold of a good artist and tell them to get to work. Or create a shitty tileset yourself and make it easy to replace the tiles if you manage to find an artist later on.

Re: LoveWars prototype/demo

Posted: Fri Oct 01, 2010 9:17 pm
by fwoop
spirulence, if you use lua's double square bracket notation for strings, then you can get a nicer looking way to represent your levels:

Code: Select all

local level = [[
........................
........................
........................
........................
....................1111
........................
.................111....
........................
........................
..............1111......
........................
...........111..........
........................
........................
............2113........
...........21111........
.....1....2111111.......
111111111111111111111111
]]
Of course then there's some string parsing involved, but once that part is coded the rest is nicer imo.

Re: LoveWars prototype/demo

Posted: Fri Oct 01, 2010 11:36 pm
by Simtex
nevon wrote:Get hold of a good artist and tell them to get to work.
This. Artists have low self esteem due to attending art schools and always having their parents tell them to get a real job. Use this to your advantage to create a dependent relationship where they fulfill your every whim. Remember, BDSM is a type of love too.

This had been your independent game development tip for the week.

Re: LoveWars prototype/demo

Posted: Sat Oct 02, 2010 11:18 am
by arquivista
fwoop wrote:spirulence, if you use lua's double square bracket notation for strings, then you can get a nicer looking way to represent your levels:

Code: Select all

local level = [[
........................
........................
........................
........................
....................1111
........................
.................111....
........................
........................
..............1111......
........................
...........111..........
........................
........................
............2113........
...........21111........
.....1....2111111.......
111111111111111111111111
]]
Of course then there's some string parsing involved, but once that part is coded the rest is nicer imo.
Hmm... Thanxs for this tip. I could use it too in the Roguelike project (http://love2d.org/forums/viewtopic.php?f=5&t=1942)

Re: LoveWars prototype/demo

Posted: Sat Oct 02, 2010 6:36 pm
by spirulence
fwoop wrote:spirulence, if you use lua's double square bracket notation for strings, then you can get a nicer looking way to represent your levels:

Code: Select all

local level = [[
........................
........................
........................
........................
....................1111
........................
.................111....
........................
........................
..............1111......
........................
...........111..........
........................
........................
............2113........
...........21111........
.....1....2111111.......
111111111111111111111111
]]
Of course then there's some string parsing involved, but once that part is coded the rest is nicer imo.
Interesting. I hadn't thought of doing that. I just implemented it and I have to agree, the levels are now far easier to edit by hand. The only potential pitfall is that it's now harder to have more than 36 tiles in a tileset. I hope that won't be a problem in the project I'm using it for.