Main Menu

Worklog

Started by Hokutoy, December 04, 2009, 05:10:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hokutoy

Hi! Worklong incoming! As always, forgive my bad english  ;) Coments and help in the other post. Thanks!

Background History:
I'm not a programmer. I don't have any informatic/mathemathic/aritmethic studys at all... so things like an Arrays, a Struct or a Pointer it's a thing i never heard berfore.
Puzsion is a perfect chance to learn about that things because the main core of the game is a struct:

STRUCT TABLERO[56]
INT X,   Y,   GRAPH,   ARRIBA,   DERECHA,   ABAJO,   IZQUIERDA, GLOW, DESTRUIR ;end=

This simple code will be used to generate a 8*7 table of jewels (first row of 7 jewels offscreen... to feed destroyed jewels).
Using this struct each process got his  X, Y, his GRAPHic, and his neightbourn jewel (UP, RIGHT, DOWN, LEFT), GLOW variable to know if the jewel is selected and DESTRUIR variable to mark the jewel for destruction.

This start it all few day ago... and now the core of the game is almost finished and works quite well.
For now i'm thinking in a way to check if there are any valid chain of 3 jewels to make the game "reshufle" if there is not more legal moves avaliable.

More ranting later.

Hokutoy

Quote from: Hokutoy on December 04, 2009, 05:10:24 PM
This start it all few day ago... and now the core of the game is almost finished and works quite well.
For now i'm thinking in a way to check if there are any valid chain of 3 jewels to make the game "reshufle" if there is not more legal moves avaliable.

Done!
This little code has took me some time of serious thinking...  ??? But now works well. It search the main struct for a posible valid chain of 3 jewels. It compare the type of one jewel with his adjacent jewels and if is the same type, it compare again his type with the adjacent jewels of the maching jewel. Basic but it works well.
FOR(CONTADOR=8;CONTADOR<57;CONTADOR++);

  IF(CONTADOR>14) //--> PARA EVITAR EL CHEKEO DE LA "LINEA 0" REFILLER
IF(TABLERO[TABLERO[CONTADOR].ARRIBA].GRAPH==TABLERO[CONTADOR].GRAPH);
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ARRIBA].ARRIBA].GRAPH==TABLERO[CONTADOR].GRAPH and CONTADOR>21); check_who=contador-7;CHECK_SI=1; frame; RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ARRIBA].IZQUIERDA].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=1;frame; RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ARRIBA].DERECHA].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=1;frame; RETURN; END
END
  END
IF(TABLERO[TABLERO[CONTADOR].ABAJO].GRAPH==TABLERO[CONTADOR].GRAPH);
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ABAJO].ABAJO].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=2; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ABAJO].IZQUIERDA].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=2; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].ABAJO].DERECHA].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=2; frame;RETURN; END
END
IF(TABLERO[TABLERO[CONTADOR].IZQUIERDA].GRAPH==TABLERO[CONTADOR].GRAPH);
IF(TABLERO[TABLERO[TABLERO[CONTADOR].IZQUIERDA].ABAJO].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=3; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].IZQUIERDA].IZQUIERDA].GRAPH==TABLERO[CONTADOR].GRAPH);check_who=contador-7; CHECK_SI=3; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].IZQUIERDA].ARRIBA].GRAPH==TABLERO[CONTADOR].GRAPH  and CONTADOR>21); check_who=contador-7;CHECK_SI=3; frame;RETURN; END
END

IF(TABLERO[TABLERO[CONTADOR].DERECHA].GRAPH==TABLERO[CONTADOR].GRAPH);
IF(TABLERO[TABLERO[TABLERO[CONTADOR].DERECHA].ABAJO].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=4; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].DERECHA].DERECHA].GRAPH==TABLERO[CONTADOR].GRAPH); check_who=contador-7;CHECK_SI=4; frame;RETURN; END
IF(TABLERO[TABLERO[TABLERO[CONTADOR].DERECHA].ARRIBA].GRAPH==TABLERO[CONTADOR].GRAPH  and CONTADOR>21); check_who=contador-7;CHECK_SI=4;frame; RETURN; END
END
END


For now, i need to think in some game mechanics to make the game more variated.

Sandman

Looks like recursion might be your friend.
-- Sandman

Windgate

About recursion in Bennu, the fact of having lots of local variables that are not really needed, I think it "overloads" a little bit, isn't it? I tried a recursive Fibonacci and I feel it slow...

I have though about a new type of FUNCTION/PROCESS called PROCEDURE that could avoid having local variables... But I don't know if such a thing is posible in Bennu right now :P
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Sandman

Very true indeed and there's been thought about a new lighter 'procedure'. Maybe it will come.
In this case though it doesn't really matter, as the recursion is only about 3 deep. And saves a lot of headache... ;)
-- Sandman

Drumpi

You can use functions, they are more lighter than process... i think, they not use graphs, files or  else, so they must be more faster... but just thinking (i don't know how Splinter made them).
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

Sandman

Functions are the same as processes, they just keep the parent waiting.
-- Sandman

Windgate

Yes, and returns what you want instead of the process id, but the load is the same. The idea is having a "light" process with no local variables, it will be very usefull for complex functions like IA and recursive procedures.
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Hokutoy

#8
Hi! The game is going nicely!
Next time i will put a video to show how the gameplay works.
Ok! time to think about some game modes:

- Quota mode:
      You must get the fixed quota of jewels to progress to next level (like Zookeeper)
       In addition, you must get the fixed quota of "chains" too. Like you need a quota of six "Chains of 10   jewels".
       You get a GAME OVER when time runs out and, maybe, when you get no more moves.

- Glass mode:
      Every time you destroy a jewel, it don't fall down. The jewel is respawned semi-transparent (glass mode). You must get all the jewels of the boad semitransparent to get to the next level.
       You get a GAME OVER when time runs out and, maybe, when you get no more moves.

- Rush mode:
      You race with the clock. The goal of the game is to go from "Chain of 3" to "Chain of 20" one by one (in crescent order) with the best possible time.
      No GAME OVER in this mode. No more moves = time penality and reshuffle of the board.

- Arcade mode:  Your objective is to get as many point as yo can in a time limit... or something like that.

Byes!
PD: Sorry for my bad english!

Hokutoy

Hi!
I made some video to show you how the gameplay looks.

http://www.youtube.com/watch?v=uPrb7EFleDA


It's a pity but the cool SF2 skin is out for the contest because of the rules but my friend Amzg is making some great gfx for the game.

Byes

Windgate

Looks really good, it is a good idea to having puzzle games... I don't remember a previous puzzle game on this game.
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

The game looks perfect, just one note: be sure to find good free graphics for the final version, as the ones you're using are copyrighted! (I read the other post on this :))

But great work!

Hokutoy

Hi!
After all the happy days... comeback to work!

My friend AMZG has done a incredible good work with the graphics of Puzsion.
Some screens of the "intro"... screens for gameplay are still a "surprise".
Almost all work is finished now... find a good free music, some gameplay tweaks, intensive betatesting and ready to go!

Byes!







Windgate

Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

FreeYourMind

Amazing the new Logo :)