Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Voroz

Pages: [1] 2 3 ... 9
1
SFML projects / Re: Chess
« on: August 26, 2016, 07:52:34 am »
Hello, Voroz

Has there been any improvement in the chess game? As I had told you, I would like to continue playing, I like chess very much ... I play since I was a kid  ;D

If you can implement the issues that were missing it would be very good  :)
I realized that my algorithm that finds the best move wasn't working like it should, so I need to make that better first. The hard part is to realize which move the player will make. He will make a move that benefits him, but how many moves ahead is the player thinking? I need to know this so the computer makes the move that benefits it the most if the player also makes his best move.

Anyway it's a bit confusing to implement this correctly, so I don't know when i feel like attempting it again :P.

2
SFML projects / Re: Super Mario game
« on: August 10, 2016, 01:02:15 am »
Unfortunately your game crashes for me instantly. Windows "A program has stopped working" comes up. Debug shows System.badimageformatexception [5152]. But judging from your data assets, alot of work went into it. Would like to try it :).

3
SFML projects / Re: Chess
« on: August 10, 2016, 12:48:22 am »
Hi, thanks for trying the game, I was beginning to think noone would reply.

All your suggestions are good, and i will try to implement most of those things. I already thought about most of these things, but decided to save them for last (except for the castle move, didn't know about that).

Adding the AI was pretty hard, but not because of the AI itself, but more because i was having issues saving everything and then restoring everything after the algorithm did its thing.

It's a quite simple algorithm though. I just put values to the chess pieces: 1-3-3-5-9-1000, and then i check every possible move that can be done by the computer, then every possible counter move the player can make, and then i check every move the computer can make again to respond.

It then checks which moves that makes the computer have the biggest point advantage compared to the player, and to add some unpredictabilty, it picks one of these moves at random, if there are several moves with the same point gain (this is why the king just moved out in the start for you, all moves would give 0 point differance between computer and you, you weren't close enough for him to see what would happen yet so he picked a random move).

Doing it this brute force way is not optimal because i can't check very far ahead in the game until it takes too long for the computer to respond. There are ways to make it more efficient though. Currently the computer has to loop about 70 000 times to calculate a response. If i wanted to check 5 moves ahead instead of checking 3 moves ahead, it would have to loop 100 million times (if we are in a situation where each player can make 40 different moves, but if it's higher, like 50 moves, then it would be 300 million and so on).

I will look into making the algorithm more efficient, and i will implement some of your suggestions, thanks again for taking some time to trying it out and giving me feedback :).

4
SFML projects / Chess
« on: August 08, 2016, 03:12:37 pm »
Hi!
Thought i'd share my most recent project that i made during 2 days. I started making it because i thought it would be interesting to create a chess AI. I managed to make one, it's not that great but for a horrible opponent like myself it's pretty hard :).



Tell me what you think, and if you can manage to beat it. (there is no end screen right now, you'll just have to know that you won"

for windows: https://dl.dropboxusercontent.com/u/150244750/Chess.rar

5
SFML projects / Re: The Possible Game
« on: April 17, 2016, 03:49:19 pm »
There's another game called Geometry Dash that is similar too (maybe same developer even?).
Anyway, good job! Yours looks fun too!
Yeah i know about that one, but that one is too crazy for me to make :P. If i was making geometry dash i wouldn't be near finished. Maybe sometime after my exams i'll add some animations and features so that it's more interesting.

6
SFML projects / Re: The Possible Game
« on: April 14, 2016, 10:54:40 pm »
Looks good! I'm familiar with the Impossible Game (although I've never played it), so I noticed the reference right away.

Quote
edit2: I also haven't gotten around to making a bigger map since it's really tedious placing the boxes at good locations. I need to make a level editor i think.

How are you making the map right now? Manually placing the boxes in code? Reading a file?
I'm manually creating them in the game constructor right now. I'm not using tiles or anything like that. A typical box creation would look something like this:
GameRectObject *box = new GameRectObject(PhysicsType::staticT, *_physicsSystem.timeToSimulate(), 3500, 500, 50, 50, Flag::fallsWhenTouched);
_physicsSystem.addItem(*box);

7
SFML projects / Re: The Possible Game
« on: April 14, 2016, 09:49:04 pm »
Thank you both for your comments and opinions.

bitano, i don't think you've played The impossible game? That's my inspiration for this game, and why i named it like this :), and it's very similar.

I wouldn't say the game is in a very early stage, depending on how much extra features i want, but the hardest part of the game is done. You could at this stage just make a longer level and call it a game, but i think i'll add some more fancy stuff.

Hyden, I will take a look at that map editor and see if it will work for my game, thanks.


8
SFML projects / The Possible Game
« on: April 14, 2016, 08:07:08 pm »
Hi!

I just want to share what i'm currently making with SFML, as a university project.
Here is a small video of the game, tell me what you think :):

edit: Also, i should mention that i'm using my own physics system for this game. That's what took most of the time to make.

edit2: I also haven't gotten around to making a bigger map since it's really tedious placing the boxes at good locations. I need to make a level editor i think.

9
General / Re: sf::Clock strangler of internets
« on: November 01, 2015, 05:12:22 pm »
I got this answer on IRC

BlueCobold:
"the clock isn't the problem
the problem is you calling it as often as possible
which needs a kernel-call
so the kernel can't handle all the other stuff it needs to do "

And they also recommended to use sleep to not run the server that often, which seems reasonable. It actually doesn't have to be that precise either. I'll use sleep first and then get the actual time passed after sleep so the box2d simulation runs well.

10
General / Re: sf::Clock strangler of internets
« on: November 01, 2015, 04:46:37 pm »
Okay i just tested an older version of the server and client.

Results are that everything worked perfectly, and then i wrote sf::Clock clock; in the beginning of the while loop.
Suddenly i see alot of lag while walking around. The internet tools aren't wrong, sf::Clock actually destroys the internet.

It works fine as long as you have a window and draw something, because that will slow down your app alot, and especially if you run vsync or framelimit, but if you just run a console window and get millions of frames a second, like on a server. Then it's a big problem.

I also don't know how to slow down the application without either using a window and then setFrameLimit, or using the clock, but the clock is the one thing that needs to slow down, so i can't use it for that ^^.

11
General / Re: sf::Clock strangler of internets
« on: November 01, 2015, 04:31:39 pm »
It might be a bug in the online tools, but i doubt it because of the network lag i'm getting in my app. If i use local IP i don't get any lag, and online IP worked without lag before i implemented box2d and the timer.

The way box2d runs on the server doesn't change based on your connection stability to the server so i believe the clock actually slows down the internet alot.

I will however try an earlier version of my network application without box2d and implement an sf::Clock to see if it suddenly starts lagging with it.

12
General / Re: sf::Clock strangler of internets
« on: November 01, 2015, 01:53:02 pm »
Do you run it on windows or linux?
I noticed that sf::Clock sets affinity mask when you call getCurrentTime. So, this is reason why it may cause deadlocks and lags in some cases.
I'm not sure if it's your case but it's better to not using sf::Clock from different threads.
It also happens when restarting the clock though. I use Windows 7, and i only use 1 thread.

edit: I gotta go for a while now so wont reply for a few hours.

13
General / sf::Clock strangler of internets
« on: November 01, 2015, 01:12:35 pm »
Hi. I've been working on a network game, and after i implemented box2d on the server i noticed i was starting to get lag, so after a while of searching for bugs i tried running broadband test before and after i started the server.
Before i had 97/97 mbit up down, and after i started the server i had about 10-15 mbit down, and 20 up.

I was thinking it was a networking issue, but i commented all my code out until this was left:

#include <SFML/System.hpp>


int main(){
    sf::Clock clock;
    while (1){
        clock.restart();
    }
return 0;
}

This code takes out 80-90% of my internet. clock.getElapsedTime(); also does it. I really need to use the timer for my application though but since it's a network app, it makes it lag.

Anyone else experience the same issue?

edit: Also this will cause the same issue:
int main(){
    while (1){
        sf::Clock clock;
    }
return 0;
}

14
Network / Re: sf::socket::Status returning sf::Socket::Error
« on: October 30, 2015, 02:33:18 pm »
I did as you said and tried out wireshark. I tried it first with my chat app, and that worked ok. I received the expected data (in hex), and i then tried my other application, and received a warning called "Zero window".

I looked it up and found out that it means i'm sending too much data. The server runs very fast and is spamming the client with way too much data i believe is my problem. That means that the client will process very old data, especially when it runs at such low fps as 60 compared to the server running super fast.

Does this seem like the probable cause?

Thanks again :).


Edit: I fixed it now so it works. I made the server only send a packet if it just received one from the player.

15
Network / sf::socket::Status returning sf::Socket::Error
« on: October 29, 2015, 09:02:00 pm »
Hi. I've been trying to get this networking to work for several days now. I started out with a bit more complex project, but did a new project now to see if i could replicate the issue with a minimal example.

If i debug the server and join a client, the socket will work for the first "frame" or step through the program. After that it will stop working and return sf::Socket::Error.

This is my code:
https://gist.github.com/anonymous/508a862ff47f41e1805f


Thanks!

Edit: I didn't store the socket properly, although this was just for this smaller example. My other code still doesn't work.

Pages: [1] 2 3 ... 9