[WIP] War of Mages (or War of <something>)

Show off your games, demos and other (playable) creations.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: [WIP] War of Mages (or War of <something>)

Post by Ubermann »

IndieKid wrote:
Ubermann wrote:I'm working right now on the AI from scratch and the tooltip when the player moves the cursor over enemies.

I can send you the source code (uncommented, quite messy and definitely not for general purpose) if you are interested.
I will write some comments in the code right now.
Cool, thanks.

If you want free V1agra check your private messages.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: [WIP] War of Mages (or War of <something>)

Post by Ubermann »

IndieKid in some obscure place wrote:Well, thanks. What is planned to do?

Code: Select all

- Magic System: cast spells and summons creatures
- Combat System: review the game mechanics and everything related
- Main Menu: with new game, options, credits and quit
- Actions buttons (cast spell, end turn, etc..) Basically some buttons in the same place that the tooltip
- Moving actual screen output to canvases (I can do this since I know better how the game works) This is in fact high priority
- Config file where screen resolution, language and such things are saved.
- AI (I'm actually working on this, but I'm not sure if what I will obtain will be good enough)
- Tooltip info (I'm working on this as well)
- Input (I'm tweaking the mousepressed)
- High Scores table (maybe this for later on?)
- Saving and Loading game? Only if we decide that the player can save and load games.
I think I forget something... Just add or modify what you want. Also remember that it would be nice if the game is portable to Android, so keep in mind the framerate and the functions you use may be not working on Droid.

Also, if we change something that is already done, we should post changes to the forum thread.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: [WIP] War of Mages (or War of <something>)

Post by Nixola »

I can be an Android tester if you need it
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: [WIP] War of Mages (or War of <something>)

Post by ejmr »

Neat idea Ubermann. Your list of things to-do reminded me a lot of things I see in roguelike games, so this list of articles may be helpful even if your game doesn't belong to that genre:

http://roguebasin.roguelikedevelopment. ... e=Articles
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: [WIP] War of Mages (or War of <something>)

Post by Ubermann »

ejmr wrote:Neat idea Ubermann. Your list of things to-do reminded me a lot of things I see in roguelike games, so this list of articles may be helpful even if your game doesn't belong to that genre:

http://roguebasin.roguelikedevelopment. ... e=Articles
Arigato.

Yes, I remember that list of things.

There is also an article in roguebasin called "15 steps to create a roguelike".

This game is almost a roguelike, but without map generationg and without line of sight, but definitely will have a lot of points in common.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: [WIP] War of Mages (or War of <something>)

Post by Ubermann »

Good News:

GAME ARTIFICIAL INTELLIGENCE FINISHED!!!!

I was almost all night working and testing it, and I finally finished the AI System that is basically homemade. Only need more testing and tweaking.

Here is an image of the AI output over the cells:
3gEuA.png
3gEuA.png (258.78 KiB) Viewed 406 times
Don't get scared of all those numbers.
It has an easy explanation:

the AI works pretty simple:
1) The game "runs" through all player creatures and saves how much threatens it every cells where the creature could move so we got a threat table (red numbers in the image). Also we add to the threat table the cells threatened by the player mage.
2) When the enemy wants to move, it uses the threat table and some personality variables to calculate which of the possible cells to move is the more efficient. (cell efficiency = cyan numbers)

For example, if the enemy mage is aggresive and prefers to kill creatures instead of the player mage, then cells that have player creatures and lowest threat will be the most efficient.
There are also some other parameters for efficiency, such as if the creature on it can be killed or not, the distance to the enemy player, and some more.

In the image, the Red numbers show the cell threat, and the cyan numbers the cell efficiency.
You can see the enemy mage is in a cell with an efficiency of 622640, which is more than any other possible cell. Enemy mage can move up to 3 cells. The numbers are shown for the last movement performed by the AI Mage, NOT the next one (the next one is calculated after the player moves).
Here the enemy mage was not much aggressive and not much wariness, and he prefer to go for player instead of enemy creatures (player creatures)

BTW I will me not releasing the code until the game is fully playable.

Actually I am the "devel team" but if IndieKid decides to join the team, we should have to discuss about releasing this AI before the game is finished.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: [WIP] War of Mages (or War of <something>)

Post by Ubermann »

I will be moving everything to canvases.

Since you where doing the game menu and such, I think you will probably need some info on this.

Actually, I have implemented a custom draw and print function, and the "print-to-the-camvas" will go in this function, so if you need to print to screen, the custom draw and print function is just as simple as:

lprint(<text>, <x>, <y>) <-- Note: it is LPRINT, not PRINT

and draw:

draw(<image>, <x>, <y>)


Both functions don't take into account the color. You will have to make a "love.graphics.setColor()" before calling the print or draw.
Also, I set the next shortcuts that you probably saw on the sourcecode I sent you, but in case you didn't:

Code: Select all

mouse = love.mouse
rectangle = love.graphics.rectangle
line = love.graphics.line
newImage = love.graphics.newImage
color = love.graphics.setColor
So you may just write "color(255, 255, 0, 255)" instead of all love.graphics.setColor.

Also, about the custom print and draw functions, LPRINT will draw a "" string if you don't pass any text string, and will print to (1,1) coords if you don't provide x or y.
DRAW will do nothing if you don't provide any image, and will draw to (1,1) if no X or Y provided.
Also this last one draws with [nearest,nearrest] filter.


I'm not sure if you got this two functions in the code I sent you, so here you got them both:
(copy paste in main.lua) NOTE: this is without canvases. I'm right now doing it. You may want to wait till I do and test it!!!

Code: Select all

function draw(image, x, y)
	if image then
		image:setFilter("nearest", "nearest")
		love.graphics.draw(image, x or 1, y or 1, 0, screenScale, screenScale)
	end
end

function lprint(text, x, y)
	love.graphics.print(text or "", x or 1, y or 1)
end
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: [WIP] War of Mages (or War of <something>)

Post by IndieKid »

The development of War of Mages was stopped because Ubermann had gone somewhere... I don't know what's wrong, but I hope everything is OK... :brows: Sorry

a bad story...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests