Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (798)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (865)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  ChessBall  (Read 41913 times)
0 Members and 1 Guest are viewing this topic.
Offline Apo
« Posted 2016-02-17 18:53:28 »

Hi,

I started a new game. It is a mix between chess and soccer.
At the moment you can play against an "easy, dumb ai" and a medium ai.

Rules:
To accomplish a victory get three points.
To score a point set the opponent checkmate or make a goal
To shoot or pass the ball, place one figure beside it. THe ball can now move like the figure. (If there is the queen and a knight near the ball, the ball can move like the queen and like the knight)
In your turn you can move one figure and pass/shoot the ball three times.

Next plans:
- better ai
- demo mode to watch/replay old games to learn or to relax done
- an interactive tutorial to learn how to move the the figures/ball done
- give the opportunity to write your own ai and load the ai done
- an android version done

Website
Chessball Website

Download:
Download the alpha. You need Java 8.
Download the android alpha.

Trailer:
<a href="http://www.youtube.com/v/SGsYjD0pUZQ?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/SGsYjD0pUZQ?version=3&amp;hl=en_US&amp;start=</a>

Screenshot:

Offline J0
« Reply #1 - Posted 2016-02-19 15:43:52 »

The frame is resizable but the content is not Sad
Which means I cannot play, my screen being too small in height Emo

Offline Apo
« Reply #2 - Posted 2016-02-19 18:14:12 »

Your screensize is smaller than 800 px height?
Mhh ok, I choose the resolution 480x800 because the plan is to make an android game.

I uploaded a new version with some improvements:
1.) frame not resizable Wink
2.) better font
3.) interactive tutorial
4.) now you can write and load your own ai.
5.) I made a website where you can download the game and get a short explaination how to write an ai (at the moment only in german, but I will translate it later)
6.) some little ai improvements

Next steps:
- much better ai
- demo mode
- a little puzzle mode with some given line up-formations and you have to score a goal in one or two steps
- android version
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline J0
« Reply #3 - Posted 2016-02-19 19:18:31 »

Your screensize is smaller than 800 px height?
Yeah, my screen is about 720 px in height hahah — and you still have to substract the taskbar height Wink

Offline Springrbua
« Reply #4 - Posted 2016-02-22 07:54:21 »

Thats an awesome idea, i can imagine, that there could be a lot of different tactics.
Also the 3 passes per turn give you some nice posibilities.
You really have to think about future turns, before moving, so that you might be able to execute a pass-pass-shoot combination.
Looking forward for the android version, i will definitely give it a try then!

A little idea:
Wouldn't it be cool to be able to combine 2 figures? So you could have a figure, which moves like a  knight and shoots like a rook.
Not sure if it fits the game...

A few questions:
- The king seems to be the keeper, so if you shoot him with the ball, you don't score right?
- If you "attack" the king, does he need to move out of the range, as in real chess?
- Can you also "eat" other figures, like in real chess?

Offline Apo
« Reply #5 - Posted 2016-02-22 11:18:59 »

...
A little idea:
Wouldn't it be cool to be able to combine 2 figures? So you could have a figure, which moves like a  knight and shoots like a rook.
Not sure if it fits the game...

It is. The ball can move like the figures that are near. If for example a queen and a knight are near, th eball can move like both figures.

A few questions:
- The king seems to be the keeper, so if you shoot him with the ball, you don't score right?
The ball can only shoot/pass on a field which is empty. So every figure can block the ball.

- If you "attack" the king, does he need to move out of the range, as in real chess?
- Can you also "eat" other figures, like in real chess?
Correct. All figures move like in real chess with the same rules. One exception is the pawn. He can move not only straight forward. He can also move sideways.

You can try the game. An alpha you can find here.


Offline Springrbua
« Reply #6 - Posted 2016-02-22 13:15:05 »

Quote
It is. The ball can move like the figures that are near. If for example a queen and a knight are near, th eball can move like both figures.
With combining i meant some kind of hybrid-figure. That means it can move like one type and shoot like another type.
Offline Apo
« Reply #7 - Posted 2016-02-22 19:48:41 »

New version is online.

What is new?
- demo mode

If you wait 5 seconds in the main menu and you can watch an old game.
When you play the game and finish it, the game will upload it and the demo of the game is available for all. So you can learn how to play the game.

Next steps:
- android version
- puzzle mode
- better ai
Offline J0
« Reply #8 - Posted 2016-02-22 21:17:41 »

- puzzle mode
I'm kind of intrigued as to what that means. Care to elaborate? Pointing

Offline Springrbua
« Reply #9 - Posted 2016-02-23 07:04:04 »

I tryed the alpha yesterday and i wasn't really able to play it.
In the first try, after my turn, the AI keeped "thinking" for a few minutes, using quite a bit of my processors capacity (it's an i7 4710mq).
After quitting the game using the menu.button i was not able to restart it, the "play" button did not react.
I restarted the game and then started with moving the queen. Then, for some reason, my turn immediatly finished and the AI started "thinking" again...
Not sure if i did something wrong...

Anyways, as i said, i really like this idea and i guess it could become really cool. Especially a multiplayer would be really, really cool!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Apo
« Reply #10 - Posted 2016-02-23 12:48:31 »

I tryed the alpha yesterday and i wasn't really able to play it.
In the first try, after my turn, the AI keeped "thinking" for a few minutes, using quite a bit of my processors capacity (it's an i7 4710mq).
After quitting the game using the menu.button i was not able to restart it, the "play" button did not react.
I restarted the game and then started with moving the queen. Then, for some reason, my turn immediatly finished and the AI started "thinking" again...
Not sure if i did something wrong...

Anyways, as i said, i really like this idea and i guess it could become really cool. Especially a multiplayer would be really, really cool!

At first thanks for trying the game =)

The problem with the ai at the moment is, it needs between 5 seconds and 10 minutes. Like I said I try to speed it up because I know it isn't really playable at the moment against the ai.
After using the menu button the game tries to break up all calculations. But this can take a while too. =(

Your turn is automatically over when you move one figure and no figure from you are near to the ball. You can play only the ball when one or more figures from you are near to the ball.

But with your feedback I will work on the tutorial. =)
Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #11 - Posted 2016-02-23 13:27:49 »

Run some calculations of what happens when you subtract two rows from each side. I want to know how much a performance hit it saves you on.

You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline Springrbua
« Reply #12 - Posted 2016-02-24 07:11:48 »

Quote
Your turn is automatically over when you move one figure and no figure from you are near to the ball. You can play only the ball when one or more figures from you are near to the ball.

Seems logical... Did not think about that... You might want to show a little information like "no moves available" or something like that? But thats just a little "nice to have".
Offline Apo
« Reply #13 - Posted 2016-03-03 22:05:28 »

A new version is online.

New features:
- ai tells more, now you can see if the ai is thinking or if the game "freezes"
- the ai has only 180 seconds per turn, after that the current best move is taken
- removed many bugs
- ai is a little bit faster, but too slow for "a normal gamer" who dont want to wait ~2 minutes per turn.
- nice android alpha version

next steps:
- better AI
- puzzle mode

AI Speed Problem:
The problem isnt the size of the gamefield. The "problem" is that you can pass the ball three times and move one figure. All in all that means you can have more than 600k possibilities in your turn. At first you have to analyse all that possibilietes and after that you have to pick the x best steps and watch what will happen when its your opponent turn.
It is really a nice problem but I cant find a good, fast solution at the moment. I use the alpha beta search but it is slow ...
Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #14 - Posted 2016-03-04 04:00:43 »

Use as little data as you can. That is the simplest answer I have for you. Instead of allocating 4 bytes for int, use a short - if it doesn't reach that high. You could also speed up by using switch when available, delegating variables to be overwritten so new ones aren't created for no reason, and cutting down on logic statements.

1  
2  
3  
4  
5  
if(something)then
-- do stuff 1
else
-- do stuff 2
end


Instead of that do...

1  
2  
3  
4  
if(not something)then
-- do stuff 2
end
-- do stuff 1


On another note, a problem you could reach is trying to do everything at once to where the processor maxes out trying to do stuff. You could use your gpu to calculate instead. Pause rendering during it's thinking time too. Anything the CPU sends to the GPU is considered bulky in this case.

You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #15 - Posted 2016-03-04 11:32:00 »

I don't think using shorts or switch* statements will have any measurable influence on performance. You need to prune the tree of possibilities, and the easiest way to do this would be to tweak the rules to make the moves less complex. Perhaps, only allow two kicks, not three? Or allow move+kick or nomove+kick+kick+kick.

* From my understanding switch is only faster for longer lists of conditions, i.e. it is quicker to do a lookup based on the switch condition than to go though a long list of if-else statements. If it is a single if-else, the if-else may well be faster than the switch. In any case, I don't think it is advisable to write tortured code for insignificant performance gains (assuming this would yield any performance).

Also to take issue with Hydroque's example the the first example means "sometimes do 1, other times do 2", while the second one means "sometimes do 2, but ALWAYS do 1". So they are not equivalent.

Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #16 - Posted 2016-03-06 00:45:36 »

Also to take issue with Hydroque's example the the first example means "sometimes do 1, other times do 2", while the second one means "sometimes do 2, but ALWAYS do 1". So they are not equivalent.
You don't know what you are talking about.

Quote
I don't think using shorts or switch* statements will have any measurable influence on performance
They do in bulk and especially in java.

Quote
erhaps, only allow two kicks, not three?
or he could bolster the most common types of moves first. That will definitely make the # of times the longer waits will occur.

Quote
If it is a single if-else, the if-else may well be faster than the switch.
I am assuming he is.


I also have another suggestion, use recursive function loops. It would be neat to have a redirection system.








You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline chrislo27
« Reply #17 - Posted 2016-03-06 01:06:35 »

Also to take issue with Hydroque's example the the first example means "sometimes do 1, other times do 2", while the second one means "sometimes do 2, but ALWAYS do 1". So they are not equivalent.
You don't know what you are talking about.

ags1 is right: your "solution" guarantees that stuff 1 always executes regardless of the something statement. No need to put down people for pointing out a mistake.

I also have another suggestion, use recursive function loops. It would be neat to have a redirection system.

Function calls are fairly slow because of pushing and popping parameters onto the stack, not to mention you'd run into stack overflow issues if you're recursing too far.
Offline ShadedVertex
« Reply #18 - Posted 2016-03-06 03:42:48 »

Also to take issue with Hydroque's example the the first example means "sometimes do 1, other times do 2", while the second one means "sometimes do 2, but ALWAYS do 1". So they are not equivalent.
You don't know what you are talking about.

Errr...actually, ags1 is right. There's no else statement to prevent 1 from happening. 2 MIGHT happen, but 1 always happens because there's no condition for it to happen; it just happens.
Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #19 - Posted 2016-03-06 05:16:08 »

I see what you guys are talking about now.

It's a method on its own. I am not saying replace all if-elseif stuff with that, I said replace it with switches. That is the other form. When you are not using switches, you are using if statements or if else statements. If statements are fine on their own, but if you are using if-else statements, it only has two forms. If it doesn't happen, go on to the rest.

You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline J0
« Reply #20 - Posted 2016-03-06 09:07:44 »

You don't know what you are talking about.
Hydroque's profile indicates 4 years of coding experience, ags1's 7 years.
Just sayin' Grin

Offline chrislo27
« Reply #21 - Posted 2016-03-06 17:00:11 »

... but if you are using if-else statements, it only has two forms. If it doesn't happen, go on to the rest.

If-else statements aren't "go on to the rest", they're "if this happens do this, otherwise do that", and not "if this happens do this, then do that".

You're right that switch is faster, but only after a certain number of elements (in C# it is five elements or more) does the switch become optimized into a lookup table or hash list. Any fewer than that and the switch is a glorified if-else-if statement.

Micro-optimizations like these are what they say: micro. Premature optimization is the root of all evil! Work on the big picture, such as not brute forcing your AI to try to find the best result out of computing hundreds of thousands of results.
Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #22 - Posted 2016-03-06 23:09:42 »

You don't know what you are talking about.
Hydroque's profile indicates 4 years of coding experience, ags1's 7 years.
Just sayin' Grin

Re-read my profile.

You can argue the semantics of what if-else is all you want. I am talking about the use of them. You should find someone else to argue this with.

You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline HeroesGraveDev

JGO Kernel


Medals: 382
Projects: 11
Exp: 4 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #23 - Posted 2016-03-07 00:59:07 »

Are you seriously arguing over switch vs if-else?

If your performance tuning is that specific then you should definitely not be using Java.

Offline Springrbua
« Reply #24 - Posted 2016-03-07 07:22:18 »

Even if there is a little performance boost, i don't think it is noticeable on todays machines.
Also the AI in this game takes a few minutes to calculate the step and this optimization won't give you more then a few seconds, which won't be noticeable for a user who wants to play the game.
So IMHO it is better to choose the easiere-to-read-solution.
Offline Hydroque

JGO Coder


Medals: 25
Exp: 5 years


I'm always inspiring a good time.


« Reply #25 - Posted 2016-03-07 09:55:58 »

Yeah am my way looks pretty too Cheesy

You think I haven't been monitoring the chat? http://pastebin.java-gaming.org/c47d35366491fHere is a compilation <3
Offline Apo
« Reply #26 - Posted 2016-03-11 17:08:43 »

Back to topic Wink

I updated the website. Now you can find a description how to create your own ai. Wink If someone is interested, that would be cool Wink

A new Version is uploaded too.
- I removed several bugs
- I "pimped" the demo mode
- I added a puzzle mode. In that mode you get a specified start formation and have to score in one turn. The goal is that the player learn to score and see the possibilites
- removed serval bugs
- the ai "talks" more while thinking

Next steps
- update the android version too
- better and faster ai Wink
Offline J0
« Reply #27 - Posted 2016-03-11 19:08:26 »

- better and faster ai Wink
I have a feeling this AI is turning into "that one thing you know you have to do to make your project work but you don't want to do it now so you'll just do it at the very end" Pointing

Offline Apo
« Reply #28 - Posted 2016-03-11 20:41:35 »

- better and faster ai Wink
I have a feeling this AI is turning into "that one thing you know you have to do to make your project work but you don't want to do it now so you'll just do it at the very end" Pointing

Yes and no. I started the ai at the beginning. Now the ai is about 15 to 20 times faster and stronger too. But it is also too slow. I need a strong and fast ai. So I try to make it better from version to version.
Offline Apo
« Reply #29 - Posted 2016-03-17 12:20:17 »

A new version is online.

Thats new:
- the ai makes no senseless moves.
- the ai is faster. [unnecessary objects removed, faster goal recognition, better heuristic]
- removed many bugs. I am suprised HOW many bugs such a small project could have ...

Next steps:
- update the android version and the publish it on the playstore
- more and harder puzzlelevel

Pages: [1] 2
  ignore  |  Print  
 
 

 
Riven (34 views)
2019-09-04 15:33:17

hadezbladez (3979 views)
2018-11-16 13:46:03

hadezbladez (1444 views)
2018-11-16 13:41:33

hadezbladez (3986 views)
2018-11-16 13:35:35

hadezbladez (769 views)
2018-11-16 13:32:03

EgonOlsen (4085 views)
2018-06-10 19:43:48

EgonOlsen (4664 views)
2018-06-10 19:43:44

EgonOlsen (2753 views)
2018-06-10 19:43:20

DesertCoockie (3647 views)
2018-05-13 18:23:11

nelsongames (3849 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!