Community Game: Current Build

Lend your skills and get involved in a CDN community game!

Moderator: samw3

User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Community Game: Current Build

Postby bugala » Sun Apr 14, 2013 10:40 am

In Hope to inspire people to join the project, I am releasing the first build I have made yesterday and today.

PC: https://dl.dropboxusercontent.com/u/3375468/communitygame/communitygamepc.exe
MacOS: https://dl.dropboxusercontent.com/u/3375468/communitygame/communitygamemacos
Linux: https://dl.dropboxusercontent.com/u/3375468/communitygame/communitygamelinux.exe
AOS3: https://dl.dropboxusercontent.com/u/3375468/communitygame/communitygameaos3.exe
Android: https://dl.dropboxusercontent.com/u/3375468/communitygame/communitygameandroid.hwa

To use Android version:

1. go to Google Play and Install Hollywood player from there to your android device.
2. After that you download the Android version from here and move it to same folder as that hollywood player is.
3. After that you should be able to start it inside the hollywood player.


Ctrl-C to quit.


It doesnt do much yet, but heres bit of explanation.

Maptiles and characters (Circles) are drawn according to map made in TILED

You can click only on tiles that have creatures in them and after that it keeps calculating the distance between the higlighted tile and destination tile.

Nothing else there yet.
Last edited by bugala on Fri Apr 19, 2013 1:05 am, edited 3 times in total.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: First Build

Postby bugala » Sun Apr 14, 2013 2:10 pm

New build:

You will now see some stats when moving over enemies of allies.

You can choose to highlight only allies anymore.

And you can move Allies until they move out of movement.

Also shows distance with red when it exceeds the movement rate.


But no new turns or attacks yet.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: First Build

Postby bugala » Tue Apr 16, 2013 1:37 pm

New build again. this time big step from programming point of view as basis for pathfinding were established.

I stole HanClintos pacman pathfinding idea and did something similar for this one.

Red blocks are supposed to be blocks where you cant enter (0 movement cost), although right now you can move there for ftree, but otherwise if you look at the map in this build you can see that instead of calculating simply the birdfly distance, it now has different movement costs for different tiles and also makes actual calculation of how many movement it costs to go somewhere.

Notice that it goes around the red blocks and looking at down-left corner, the cost is hefty as you first need to go around the red blocks by going up-left corner before you can get there.



Those of you interested in more technical aspect of that pathfinding, heres how it works.


First I will mark each map pieces movement cost as 0.

Then you choose a center piece, in this case one of your higlighted allies. Lets suppose this ally is on spot 0,0.

After that, all adjacent tiles are being checked, which means:

-1, +1
0, +1
+1, +1
+1, 0
+1, -1
0, -1
-1, -1
-1, 0

Checking means that it will check what is the cost from current tile to move to that adjacent tile and it will save that cost to that tiles info.

When comparing to a tile that already has a distance in it, it will check wether the new movement cost is cheaper than the previous. If it is, then it saves the new lower distance.

If distance was changed, then it will list changed pieces x and y coords to a queue so that that block will also be checked as center piece similarly as this example one.

After queue is empty, it means that all the pieces have been checked through, and the ones that werent checked, are not accessible and hence their movement cost is infinite (currently 0).
User avatar
HanClinto
Site Admin
Posts: 1502
Joined: Sun Dec 16, 2007 8:37 am

Re: Community Game: First Build

Postby HanClinto » Tue Apr 16, 2013 9:23 pm

Is this source up on bitbucket / github? I'd like to give you a review of the source code -- especially the pathfinding. Thanks for the writeup, and taking the plunge on this!
""

._Image
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: First Build

Postby bugala » Wed Apr 17, 2013 12:24 am

You can download the source code from:
https://dl.dropboxusercontent.com/u/3375468/communitygamecode.hws


the main pathfinding parts are:

p_MakeDistanceMap and
p_CompareRoute


Hope you can read that code, I havent had any real plan on design but have been modifying it on the fly and have been for example thinking of making Table MAP maybe again bit differently as current version makes it bit hard to read what is happening many times.

There are only very few comments, mainly for myself.


Oh, and the pathfinding is at very simple state right now. I plan to add systems in place for it to recognise if some routes are basically acceptable but currently blocked and also add some sort of info if thing blocking the way is for example some wall that can be destroyed.

But dont know when i will do those parts yet. That enemy blocking part i might do soon already as I think I need that for some of the AIs im thinking of.
User avatar
HanClinto
Site Admin
Posts: 1502
Joined: Sun Dec 16, 2007 8:37 am

Re: Community Game: First Build

Postby HanClinto » Wed Apr 17, 2013 8:59 am

What language / engine does this source code use?
""

._Image
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: First Build

Postby bugala » Wed Apr 17, 2013 9:36 am

It is called Hollywood, it is based upon LUA.

http://www.hollywood-mal.com
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Wed Apr 17, 2013 11:27 am

New Update again. Same links as always and also code updated.

Now the pathfinding knows wether way to some location is blocked or not (Displays blocked on info).

You also cant go to 0 cost places anymore which are supposed to be non accessible tiles.



More technical aspect for the new blcoked pathfinding thing on how it works:

When pathfinding chooses the center piece, it looks wether that piece has a creature in it or not. If it has, it will mark it as blocked.

If center piece is blocked, then it also means that every piece that it connects to will be blocked way too, and hence if distance on any of the adjacent tiles is changed according to center piece, it will mark these adjacent pieces as blocked ones too.

Due to this new system, there came couple of new rules. Before this it was simply checking wether new route is shorter path than old one, but since it is obviously shorter to go through a tile having creature in it, than it is to go round the creature tile, this creates the situation where the blocked route will most of time be shorter than non blocked way.

Hence it will check wether center piece in use is blocked or not and then it will check wether adjacent piece is blocked or not.

If center piece is not blocked but adjacent piece is marked as blocked, then regardless of the distance, the non blocked route will be marked as a new route.

similarly if blocked route is shorter than old route but old route is non blocked, it will always keep the old route.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Thu Apr 18, 2013 12:36 am

Another update, big one this time.

1. I added to pathfinding a system that keeps tracing the path of most cost efficient route.

2. There is now End Turn which results in both AI movement and your own people getting mvoements again.

3. As already mentioned in two, there is now first AI, a very simple one. current AI is simply reaching towards Goal x,y which currently is 14,3 which is right edge middle square.

4. I added Android version (link and instructions can be found from the original post). If someone has Android in Mobile device, it would be very heplful if you would test this out and tell if size of tiles is good, or should they be bigger or can they even be smaller?




More technical explanations again:

Best route works quite simply.

In pathfinding part whenever any tiles distance is moved, it will sort of mark an arrow pointing from which direction is the center tile from that tile (center tile being the one from which the route is checked from). This arrow in pracitce is string like "up", "upleft"... but its easier to think them as arrows attached to each tile.


At End Turn movement amounts are looked so that if creture has less than 1 movement left, then new movement is movement left + normal movement amount.

If there is more than 1 movement left, then it is simply normal movement + 1.

Hence there can read in character info movement: 5/4 or 4.3/4



First AI is very simple. It makes each enemy a pathfinding map (or actually i call it distancemap in code, since it checks every tile through and marks their distance to the tile itself).

After AIs distancemap is done, then it looks at spot 14,3 (which is the goal tile) and starts tracing road back by following those arrows.

Each time it moves from one tile to next one using arrows, it check if this tiles total movement cost is less than there is movement left with that enemy.

If enemy has more movement left than is the moving cost, then it moves to that tile.

In case arrows come all the way back to enemy creature, then it doesnt move anywhere.



By otherwords, this Ai simply moves towards its goal and doesnt engage in combat. If you move your own guys (yellow squares) on their way, you can see how they keep changing direction and try to get around you.

In the end they will all be in same bunch as they are on eeach others way and wont move anywhere as tehre is no way to get closer to their goal anymore.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Fri Apr 19, 2013 1:09 am

Another, coding wise, small update.

Notice that the download links have now changed as i made own directory to my dropboxes public folder for Community Game.


You can now attack enemies (those blue balls) and instead of jumping to new locations, balls now actually move to their new location (but not through pathway).


not that tecnical explanation but:
current attack mechanism is very simple, Damage caused is based upon DMG - DEF.

There are also number of attacks each turn. Each attack reduces the number by 1.

Wether someone can attack or not is based upon range. Range currently is 1.7.

Range distance is based upon birdfly distance, which means that each square is only 1 away from each other, except if moving corner squares, cost is 1.7. Hence 1.7 range means that you can attack any adjacent tile.

With loner ranges you can have archers and with bigger number of attacks, you can have multiple attacks each turn.

(neither multiple attacks or archers are there at current build, but it is just a matter of changing number)
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Sun Apr 21, 2013 1:32 pm

Another update.

Now AIs will attack you.

I improved the first AI, if there were many AIs going to same place, they in the end ended up on queue. Currently the AI tries to find the closest available open spot towards te goal instread of going to queue when each AI tried to follow the same path. You however wotn see that improved AI in this build in practice as currently all enemies share same AI mode.


Current AI mode is the new AI the "attack nearest" AI.

AI active in this build seeks for the nearest enemy and moves towards it and if close enough, attacks.

There is still at least one problem with this AI, namely the problem that even when its at best possible location to attack, it will still keep moving instead of staying still. But it will anyway do for now.


A bit of more technical info about "Attack Nearest" AI.

First There will be build Distance Map from current AI unit to see how far each tile is.
Then each tile is looked through and each tile that has Ally creature (by other words - enemy unit) in them, will be checked the distance of.

If distance of current check is shorter than previous checks have been, then this new unit will be chosen as target (x- and y-coords saved).

After target is chosen, a new check begins.

First each tile is checked through and ones that it is possible to move with current AI unit, are marked down (conditions are that tile doesnt have creature, there is way to get there, and distance is less or equal to amount of movement left for that turn).

Then another Distance Map is made. A Distance Map from target unit to every tile.

After this all the marked tiles (the ones where AI unit can go) are compared to target distance maps distances. If target maps distance is shorter than current shortest distance, then checked tile is market as new target tile.

After this is completed we now have closest to enemy tile that is still reachable during this turn and where AI unit is allowed to go and Ai unit will then move to this new tile.

After movement is done (or if no movement is done at all) AI will check if its attack range can reach the target unit, if it can, then it will attack.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Mon Apr 22, 2013 2:14 pm

A Minor update again.

There is now another grey button on left side of "End Turn"-button.

If you click on that one, it will change into dark grey, which means it is selected, click again, to unselect it.

This new button is "New Unit" button.

After "New Unit"-button is selected, you can click on empty spots on map to deploy more circles there as long as you have enough Command Points left.

This is just for concept testing purposes, and hence you can only build more of the same and cost is fixed to 40 command points (You will have 100 at start).
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Tue Apr 23, 2013 2:13 pm

New Build.

- I removed all the units that were placed to map at beginning of game (feature is still there, just that i put it empty at beginning).

- Attack Waves are now implemented. Currently it works on turn basis. Each turn it checks predesigned attackwave if some more units should be deployed and where. Currently they always come from left edge on randomly chosen vacant spot.

I plan to add more options in future, like that some enemies come after some other ones have been slayed first, but right now it is simply turn based.


- Each time enemy is killed, player gets 10 Command points (40 points to buy new units, 100 CPs at beginning).


- Each time enemy is killed, killer ally gets 10 XP

- Get enough XP, gain a level. 130 for LVL 2, 180 LVL 3, 250 LVL 4. Other levels gain more DMG, DEF and HP, but LVL3 gives you 2 attacks per turn instead of just one.


If you dont put any units on map, then computer units will stay still as they are all on "Attack nearest" AI.


Lots of things are still missingm like different kind of units, limited development areas, xp from each attack... but it is starting to shape up for idea testing purpose quite well already.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Sat May 04, 2013 3:27 pm

Although I planned on not showing next update until having this further, I decided to make next build already just to show that there is something happening.

This is still quite buggy, as example other of the yellow balls should have 4 movement just like the other, but some strange bug occurs there making always one of the yellow balls go 0 movement and i havent even found the logic yet by which that ball is chosen. Just no matter the number of balls, one of them is always 0, and its not first, nor the last ball to be checked, or might be, depending upon where the rest of the balls are present.


Anyway. There isnt that much seeable progress, most progress is under the hood this time.


Seeable new things:

- I am using some of B-Os tiles to test TILED and make it slightly nicer looking.

- Game is now supposedly starting from title screen, which only has that green box which means "Start Game". After that it progresses to Map screen, which shows levels available to play, only that green ball only, by clicking which you get to the actual game (level 1)

- You can get pretty good idea about what Level 1 could look like if we so decide with this build, although it is not completeable yet, and captain resistance wont even show up yet.

Idea is that tisiphone would need to be dragged all the way beside the town wall and then on turn 20 captain resistance would show up and tisiphone would shoot him.

However, Enemies, the captain resistances men that were out of town on a scout mission looking for greener pastures from Forbidden Valley are now coming back to town and they will try to kill tisiphone! If they succeed it would be game over (but that is not programmed yet)

You can also see Diabolus inside the town wall who has 0 movement. For he is there talking to townspeople. Each round there could come new speech bubble or something.



Under the hood things:

- TILEDs LUA output is now very much integrated to my code. I can pretty much just copy paste the LUA code that TILED gives and it works.

- TILED editor is now used to set up properties of creatures and tiles. For example movement cost is put inside TILED to each different kind of tilepiece independently and code will use it. This will give level designers very much power in desiding what levels should look like.

- Creature creation is the latest thing i have been working with:

* You can use TILED editor to put creatures at start of level and decide their properties there (ie. how much HP, DMG, DEF, movement etc. creature has which can be anything you decide).

* It is now having base to check things from. That if you for example decide that there should come swordman LVL 2 to map, it will have that kind of swordmans generic stats that it will use and in addition, if you want to put some of the properties there yourself manually, you can do that too.

It is just basically that you send a table containing stuff that you want there to be, and rest it will fill automatically based upon unit type and level.

These new features are unseen in this build however, since they are not in use there.

Next build I hope will show you how there will be coming tougher enemies around.
User avatar
Mene-Mene
TALKer!
Posts: 2760
Joined: Sun Dec 16, 2007 7:10 am
Location: Indiana, United States

Re: Community Game: Current Build

Postby Mene-Mene » Thu May 09, 2013 2:09 pm

I'm impressed by what you've gotten done Bugala, I commend you.

I would like to say that you're not likely to be relieved of programming any time soon due to the language choice.
M^2 out-
It's Time to get Terminal!
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Thu May 09, 2013 2:45 pm

Thanks Mene-Mene. I hope to bring more updates soon. Just been having a flu for over a week now thats been preventing my coding a lot. Right now it does so that everytime i sit down my stomach starts hurting, so havent been in front of computer much. Only very short whiles at a time.

And yes, that was my plan that I would code it from beginning to end. Unless I can figure out a way for other coders to join too, but right now, unless they know at least lua, theres not much to do, and even then my code is quite messy as i didnt have clear plan at a beginning how to do many of the things.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Sun May 12, 2013 5:12 am

New Build

Now enemies are picked from similar table as your own units are which makes it possible to make enemies by telling their type and level.

Only the first enemy attacker is Level 2 attacker as I only tested that it works, rest are level 1.

You can also control every other aspect of the enemy by manually putting HP, HPMAX, DMG, DEF... every attribute.

This total control have also made it possible that at turn 20 Captain Resistance shows up.

I havent yet made AI for ranged units, so therefore there are still only swordmen coming, but they are now coming with 3 different AIs, the ones I have explained on earlier updates which means that 2 os the AIs are simply reaching towards goal and only one AI type is attacking the nearest enemy.

I also simply just copy pasted the swordman/archer table from own units side, so enemy Swordmen are now equally good with your won guys.


Last addition worth mentioning is the new naming system. Instead of having Ally1, ally2... and enemy1.. enemy2 They are now displaying the type of unit or in case of Unique unit, the name of unit.

Your own units will show up as swordman1, swordman2... archer1, archer2...

But enemy units will simply show the type of unit, ie. Swordman. Nothing else.


Reason for showing your own units by numbers is since I am planning units XP and LVL to pass on to next levels. Hence it is important for player to know which unit is which.


There is still no level fail or game over.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Sun May 12, 2013 2:11 pm

Another update build in same day still.

This one has big step achieved again.


You can now actually play the first level from beginning to end. I reduced enemies XP down a lot so you can easily win the first level to test it out.

This is what Level 1 could be like.

Remember, tisiphone is only one able to kill Captain Resistance, so you need to drag him right beside him on the wall.


- Level Ending Conditions put in place: Failure - Tisiphone dies or turn 30 reached. Victory: Captain Resistance is killed.

- If you fail on level, you will get message and it will return you back to map screen (that green ball thing on black screen)

- if you win, you will still get a message (that doesnt fit on screen) and it will change original green ball to red ball (indicating that level is completed) and add two more green balls indicating level 2 and level 1 on hard mode. Neither of these exist in reality, so if you click either of these balls, it will crash since it wont find the level data for them.


- XP and Command Points gainage is now based upon points given to each unit and which can also be given manually to each independently. Right now it goes so that Level 1 guys bring 10 XP/CP, LVL 2 15 XP/CP and LVL3 (you wont encounter any of those in current level) 20 XP/CP.

- You will also gain XP just from hitting someone. It goes so that you get: XPfromkill * ( DMG / MAXHP ) which means that if someone gives you 10 XP, there is actually 20 XP in total to be got. 10 total from hitting hes energy down, and another 10 from actual kill.

- I fixed bug i hadnt noticed before which actually made you be able to move enemies as well as your own units.
User avatar
bugala
Posts: 1279
Joined: Wed Oct 21, 2009 11:43 pm
Location: Finland
Contact:

Re: Community Game: Current Build

Postby bugala » Wed May 15, 2013 2:47 am

New build.

There is now simple text output system to put text out betweem turns.

I have put it in example use to give instructions for first level. (actually, despite what text says, wether Captain Resistances men reach Ear Gate or not, doesnt really matter..

I probably wont make that text system any better until we get to the point where we actually start seeing what graphics will look like in the end so I know what kind of text and text features I should implement.
achild
Posts: 308
Joined: Wed Jul 01, 2009 8:42 am
Location: McKees Rocks, PA

Re: Community Game: Current Build

Postby achild » Wed Jun 12, 2013 10:17 pm

Oh wow, the forums look nicer. Cool job guys!

I am just posting to encourage bugula, and to announce (which he already knows) what has been going on during the last 1 1/2 weeks with Basis.

He bought me an Amiga emulator with roms (copyrighted) as well as legally transferred one of his licenses for Hollywood to me, which is what he is developing the community game in. It's literally lua with a couple tweaks for scripting numerous built-in libraries which are meant for interactive graphics presentations, and compiles to multiple platforms all from whatever system you run it on. (Bugula gave me his Amiga version. I have never used Amiga anything before!)

Anyway, after much tinkering and experimentation (and frustration, at times) we managed to develop a plugin for Hollywood to play Basis animations. This really takes Hollywood's game making abilities to a new level as it has no native support for things like this. We even had to develop a software alpha textured triangle renderer because there was no other option. Anyway, I managed to cross compile binaries of the plugin (written in C) for Amiga OS3 and AROS and linux and windows. No OSX unless I get a real Mac one day though :(

So, Bugula's gifts paid off for us both, and it is ready to use in the community game now!!! His encouragement really couldn't have come at a better time, as well. Plus, now I have experience with Lua, and Lua <-> C, and Amigas, which is super neat.

So thanks Bugula.

We will be releasing Basis for public use shortly. I wanted to finish the Hollywood plugin first. Stay tuned!

[edit]Oh - here's examples of Hollywood + Basis animations. Binaries and source included for everything. The ExampleHollywood files are of course the ones of most interest in this context. There's linux, windows, amiga builds, as well as windows examples using SDL, and HGE. More to come soon.

Demo Binaries/Source

Who is online

Users browsing this forum: No registered users and 0 guests

cron