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 - CJ_COIMBRA

Pages: 1 ... 6 7 [8]
106
General discussions / Language switching
« on: January 11, 2011, 04:25:05 am »
Greetings,

Most of my games were just prototypes and tests, but recently I´ve finished an entire game and I presented it in english and portuguese. I made this by setting the texts in both languages and just switching them according to player´s choice on start screen. Then the engine just instantiated the language handler with the right language.

I was wandering how do you guys handle this topic in your games. Is it better to just recompile it into another build totally apart on from the other?

Does it really make any difference having the player to choose the language? Would someone be bothered by doing this?

107
SFML projects / SKIRMISH II - Viking Assault
« on: January 11, 2011, 03:59:34 am »
It has a little help file in the folder (README) and also has some information on the controls on the help menu.

Besides that, you just need to explore the map and defeat any oposing enemy.

Thank you for testing, this is my first "real" complete game. I did what I could on design and interface but hey I´m a programmer!

108
SFML projects / SKIRMISH II - Viking Assault
« on: January 10, 2011, 04:57:02 pm »
I´ve finished the beta release.

Please, take a look and leave your comments!


http://www.4shared.com/file/Xsfjj2BB/SK2_Beta_Release.html


Thanks!

109
General discussions / SFML Logo
« on: January 09, 2011, 10:55:05 pm »
Thanks,

I know you hear this a lot but your library is amazing. Few people in my country (Brazil) know it but I am spreading it around as much as I can!

110
General / Suggestions on AI issue
« on: January 09, 2011, 10:46:15 pm »
Greetings,

First I want to say that this is not a bug or problem, the game is running fine and the AI is working as expected in termos of final result. The problem is that I wanted it to "look a bit different".

The game is turn-based and uses regular quads for tiles in the map. When player ends its turn, a function from the enemy class is called a number of times equal to the total number of instantiated enemies, on the game loop.
Inside this function a given behavior is iterated a number of times equal the total amount of movement for that enemy unit.  Here is the parts of the code I´ve mentioned:

The part in which the artificial inteligence procedure is called (it is inside the game loop):
Code: [Select]
//EXECUTA IA NO TURNO DO COMPUTADOR
            if (jogador->turno == false) // mapa global e turno do computador
            {
                for (i=0;i<50;i++)
                {
                    saxoes[i].executarInteligenciaArtificial(vikings, gerenciador, conversorString);
                }
                //Depois de atribuir ações para todos os inimigos reinicia o turno do jogador
                jogador->iniciarTurno(vikings);
                gerenciador->txtMensagem.SetColor(sf::Color(220,220,0));
                //Verifica as condições de vitória
                if (motor->condicaoDeVitoria(saxoes,cidades))
                {
                    gerenciador->txtMensagem.SetColor(sf::Color(220,220,0));
                    gerenciador->txtMensagem.SetText("VITÓRIA! Inglaterra agora é Daneland!                                                                      (ESC) SAIR");
                    motor->setEstadoGlobal(3);
                }
                //Verifica as condições de derrota
                if (motor->condicaoDeDerrota(vikings))
                {
                    gerenciador->txtMensagem.SetColor(sf::Color(220,220,0));
                    gerenciador->txtMensagem.SetText("DERROTA! Festeje no Castelo dos Mortos em Asgard!                                                                      (ESC) SAIR");
                    motor->setEstadoGlobal(4);
                }
            }





This one is the function of the Saxao class that represents the saxon enemies:

Code: [Select]
void executarInteligenciaArtificial(Guerreiro *vikings, ResourceManager *gerenciador, StringConverter *conversorString)
        {
            gerenciador->txtMensagem.SetColor(sf::Color(220,0,0));
            int cont;
            int cont2;
            int direcao;
            int alvo;
            //sf::Clock timer;
            //timer.Reset();

            if (inteligenciaArtificial == 1 && vivo)
            {

                for (cont=0;cont<50;cont++)
                {
                    if (vikings[cont].vivo && tileX - vikings[cont].tileX <= alcanceVisao && tileX - vikings[cont].tileX >= -alcanceVisao && tileY - vikings[cont].tileY <= alcanceVisao && tileY - vikings[cont].tileY >= -alcanceVisao)
                    {
                        for (cont2 = 0; cont2 < movTotal; cont2++)
                        {
                            if (vikings[cont].tileX < tileX && vikings[cont].tileY < tileY)
                            {
                                direcao = sf::Randomizer::Random(1,2);
                                if (direcao == 1) tileX -= 1;
                                else tileY -= 1;
                            }
                            else if (vikings[cont].tileX > tileX && vikings[cont].tileY < tileY)
                            {
                                direcao = sf::Randomizer::Random(1,2);
                                if (direcao == 1) tileX += 1;
                                else tileY -= 1;
                            }
                            else if (vikings[cont].tileX > tileX && vikings[cont].tileY > tileY)
                            {
                                direcao = sf::Randomizer::Random(1,2);
                                if (direcao == 1) tileX += 1;
                                else tileY += 1;
                            }
                            else if (vikings[cont].tileX < tileX && vikings[cont].tileY > tileY)
                            {
                                direcao = sf::Randomizer::Random(1,2);
                                if (direcao == 1) tileX -= 1;
                                else tileY += 1;
                            }
                            else if (vikings[cont].tileX < tileX && vikings[cont].tileY == tileY)
                            {
                                tileX -= 1;
                            }
                            else if (vikings[cont].tileX == tileX && vikings[cont].tileY < tileY)
                            {
                                tileY -= 1;
                            }
                            else if (vikings[cont].tileX > tileX && vikings[cont].tileY == tileY)
                            {
                                tileX += 1;
                            }
                            else if (vikings[cont].tileX == tileX && vikings[cont].tileY > tileY)
                            {
                                tileY += 1;
                            }
                            //Ataca se possivel
                            if(vikings[cont].tileX == tileX && vikings[cont].tileY == tileY)
                            {
                                if (atacar(vikings[cont].defesa))
                                {
                                    //atacou acertou e matou
                                    if (vikings[cont].receberDano(aplicarDano())) gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(7,nome.GetText(),vikings[cont].nome.GetText()));
                                    //atacou e acertou mas não matou
                                    else gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(6,nome.GetText(),vikings[cont].nome.GetText()));
                                }
                                //Atacou mas não acertou
                                else gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(8,nome.GetText(),vikings[cont].nome.GetText()));

                            }
                        }
                        //Corrige a posição do inimigo ao final do seu turno
                        if(vikings[cont].tileX == tileX && vikings[cont].tileY == tileY) tileX += 1;
                    }
                }
            }

            //Instancia defensiva
            if (inteligenciaArtificial == 2 && vivo)
            {

                for (cont=0;cont<50;cont++)
                {
                    if (vikings[cont].vivo && tileX - vikings[cont].tileX <= 1 && tileX - vikings[cont].tileX >= -1 && tileY - vikings[cont].tileY <= 1 && tileY - vikings[cont].tileY >= -1)
                    {
                        for (cont2 = 0; cont2 < movTotal; cont2++)
                        {
                            //Ataca se possivel
                                if (atacar(vikings[cont].defesa))
                                {
                                    //atacou acertou e matou
                                    if (vikings[cont].receberDano(aplicarDano())) gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(7,nome.GetText(),vikings[cont].nome.GetText()));
                                    //atacou e acertou mas não matou
                                    else gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(6,nome.GetText(),vikings[cont].nome.GetText()));
                                }
                                //Atacou mas não acertou
                                else gerenciador->txtMensagem.SetText(conversorString->concatenarMensagem(8,nome.GetText(),vikings[cont].nome.GetText()));
                        }
                    }
                }
            }
        }




The issue is that I wanted the enemy movement to happen slowly enough so that the player could notice enemy moves. The actual code makes the enemy turn almost instantly finished.

I tried something with timers but something went wrong and it crashes... maybe someone faced a similar situation and could share with me his/her opinion.

Thanks

obs: Sorry for any bad english, I speak portuguese natively.

111
SFML projects / SKIRMISH II - Viking Assault
« on: January 09, 2011, 10:32:05 pm »
Greetings,

This is a fast turn-based strategy game with vikings theme. The goal is to defeat the saxon resistance and take all britain cities. You get reputation and gold when you defeat an enemy or take cities.

The controles are very simple and explained on the help screen.

I´ve used SFML for everything on this game. This is my second game with SFML, but the first one was never completed.

I´m planning on release the game during this week, but here are some preview screenshots:
http://masmorra-rpg.blogspot.com/

Thanks

112
General discussions / SFML Logo
« on: January 09, 2011, 10:26:51 pm »
Greetings,

Can I use SFML logo in my game start screen, saying "made with SFML" or something like that?


Thanks.

Pages: 1 ... 6 7 [8]
anything