[UFEC] Cycle

Started by
34 comments, last by rip-off 13 years, 2 months ago
Oh, well. The tecture is terrible and I'm not quite confident with the mesh of the vulcano, but it is an idea of a possible solution.

So far for the "eye candy". Yesterday I managed to install the target environment on my computer. Guess what... Yes it's Maemo 5. I hope the community manages to migrate SDL to Maemo in time. Otherwise, I have to shift my time schedule...



So far for the screen-shot spamming. Have to get back to Code::Blocks :/
Advertisement
Again a complete week related to only one topic. The AI. This is my first attemp to code a working AI not with differential equations. A ton of if loops needed to be designed - for just one function. It took me the complete weekend to assemble the basic AI function. All AI functions return a factor with which the computer makes its selection (if everything works correctly). After creation of all functions I thought of a kind of brute force mechanism to guess future steps (a little bit like check). But this is not decided yet.

Here a screeny from Cycle with the casual gameplay mode and a snap-shot from my main function, which calls the AI functions.

...what a brainteaser...



Updated Schedule

Define Game Mechanics (check)
Implement Game Mechanics (check)
Define supporting features (launched) and AI (check)
Implement supporting features (launched) and AI (launched)
Define graphics style (launched)
Artwork (launched)
Sound Design
Implementation of Art and Sound (launched)
Balancing
Testing
Documentation
Industrialisation on Windows/LINUX (UBUNTU and MAEMO)
I started coding one of the core bits, thats puts depth into the gameplay - the trading card game mode. I still am not convinced with the actual approach on how to rate the cards when played by the computer, but the functionality is improved compared to the status 1 month ago. See below a screenshot of two parties (called pacts) play each other. Brotherhood of Flame vs. Lords of Ice. Both in their own scenario, with own decks (cards). The art-style of the cards is close to final, the one of the background not.

Sluggish progress during christmas vacation. Maybe due to christmas. Who knows. However here are the first designs of the trading cards. More in progress, this is just a teaser.


Lords of Ice


Brotherhood of Flame


I recognized, that creating just one card takes more than 2 hours (design, art, text, implementation, source code). Maybe I have to skip the two other pacts. It starts to become time consuming.

Happy new year to everybody.
Today I finished the decks of Brotherhood of Flame and Lords of Ice. This is a big milestone, because the human vs human gamelplay is finished now. The AI is still outstanding and the graphics are ugly. No screenshot because of spoiler alert. But it's time to update the schedule.

Updated Schedule

Define Game Mechanics (check)
Implement Game Mechanics (check)
Define supporting features (check) and AI (check) <-------!!!
Implement supporting features (check) and AI (launched) <------!!!
Define graphics style (launched)
Artwork (launched)
Sound Design
Implementation of Art and Sound (launched)
Balancing
Testing
Documentation
Industrialisation on Windows/LINUX (UBUNTU and MAEMO)

Looking at the schedule, I realized that it is again challenging to finish in time. AI is probably taking a month. For artwork I think I need another week for definition phase and 3 weeks for implementation (painting, particle engine, other effects...). Gives me not enough time for balancing and testing.

Argh, it's just a board game. WTF am I doing wrong?!?
It took the complete last week to figure out how the computer plays with cards. After a lot of trial and errors I found a way using function pointers, which are very similar to virtual functions. I descided to use function pointers and not virtual functions, because the basic architecture is not designed to make derivatives of the card class...
Unfortunately the main function grows and grows, which makes it very hard to keep overview over the code. It's still structured, well... somehow...

Here a new screenshot



p.s. the computer wins too often.
Could you provide an overview of how the game plays? I mean, question one: how do the cards map to the interesting and visually cool board?

I have more questions, but an overview would be nice :)
Quote:Original post by XDigital
It took the complete last week to figure out how the computer plays with cards. After a lot of trial and errors I found a way using function pointers, which are very similar to virtual functions. I descided to use function pointers and not virtual functions, because the basic architecture is not designed to make derivatives of the card class...

If you haven't already, you may want to look at
FastDelegate or boost::function (or std::tr1::function if your compiler supports it).

Life with function pointers gets much easier this way.
@popsoftheyear:
I'm satisfied with the solution I have right now. Most important: I understand my code even after 3 days of absence.

the assignment is:
   deck_BoF[0].LoadResource("./deck/BoF_Fireball.txt");   deck_BoF[0].SetAction(ActionBoF_Fireball);   deck_BoF[0].SetTryAction(TryActionBoF_Fireball);


the implementation is:
   void  (*Action)    (void);   float (*TryAction) (void);


and:
   inline void SetAction(void (*_fcn_handle)(void))     { Action  = (*_fcn_handle); }   inline void SetTryAction(float (*_fcn_handle)(void)) { TryAction = (*_fcn_handle); }


It's possible to call the functions from outside, because they are member functions from class "card". It was easier to do it this way, than to use virtual functions.

See the implementation inside the AI function part, which is used to balance the chances, which card to be played. It works without memory leak and increasment.
   if (play_with_cards){      //Maximum of three active cards available      //Chance, which card to be played best      std::vector<int> index;      index = player[active_player].GetActiveCards();      std::vector<float> chance;      for (int iCard = 0; iCard < (int)index.size(); ++iCard){         active_card = index[iCard];         chance.push_back(player[active_player].deck[index[iCard]]->TryAction());      }      if (chance.size() > 0) {         //Which card has highest chance to be played?         int best = Math::MaxFIndex(chance);         //Play Card if Chance higher than 60%         if (chance[best] >= 60){            effect_player = active_player;            effect_card   = index[best];            active_card   = index[best];            Action();         }      }   }


The Action is used by AI and by player, therefore I needed to capsulate it:
//------------------------------------------------------------------------------void Action(void){//------------------------------------------------------------------------------   if (player[active_player].deck[active_card]->Action != NULL &&      !player[active_player].deck[active_card]->IsBlocked()){      player[active_player].deck[active_card]->Action();      if (player[active_player].deck[active_card]->IsTagged())         player[active_player].deck[active_card]->SetBlock(true);   }}



@Jason:
Goal of Cycle is to occupy the most fields. You see the red nodes at the crossings? Those have to be occupied by tokens. The player with the most occupied tokens around a field occupies the field. If the number of player and enemy tokens are the same, the field is freed. The cards can be used to delete enemy nodes, steal enemy nodes, reduce enemy points (needed to play cards), modify card status (block, discard, draw new) or similar stuff. To increase the strategic part, I need to do a bit more balancing. The cards are finished in design, but need to be improved a bit. Right now, Brotherhood of Flame is a bit too strong. However, the computer is able to play itself.
This is the latest update of Cycle development. I put a complete week into sound engineering and descided to skip the whole sound stuff because of the following:
SDL_sound does not match 100% with existing code architecture -> redesign would take a week
OpenAL too few knowledge (however it seems to be not so difficult) -> get in touch and implementation would take a week
FMod C (Windows) vs C++ (Linux) -> additional cross compilation efford would take a week
Additional sound effects, ambient sounds and sound engineering would take another week.

Leading to two weeks for ear-candy. Cycle is playable without sound effects. Therefor it is just "nice to have". I know that it reduces atmosphere, but priorities have to be set.

Updated Schedule:

Define Game Mechanics (check)
Implement Game Mechanics (check)
Define supporting features (check) and AI (check)
Implement supporting features (check) and AI (check)
Define graphics style (check)
Artwork (check)
Sound Design (skipped)
Implementation of Art (check) and Sound (skipped)
Balancing (check)
Testing (check)
Documentation (launched)
Industrialisation on Windows/LINUX (launched)

Outstanding Items:
QRG
Small Improvements (ESC, QUIT buttons, ...)
Installation Script LINUX
Windows Compile
Installation Wizard Windows

This topic is closed to new replies.

Advertisement