Recent

Poll

Vote: What's the best project of this year?

"ball" by raw
1 (3.7%)
"bgragraphics" by j-g (pocket watch)
2 (7.4%)
"duplo6" by bylaardt
7 (25.9%)
"glslideshow" by handoko
2 (7.4%)
"mariocronch" by ericktux
0 (0%)
"movingdots" by lainz
1 (3.7%)
"movingdotsgl" by lainz
0 (0%)
"relogio" by bylaardt
5 (18.5%)
"starsfieldshooter" by turrican
0 (0%)
"steampunkclock" by bylaardt
1 (3.7%)
"sudoku" by user137
5 (18.5%)
"furiouspaladin" by handoko
3 (11.1%)
"educrace" by lulu
0 (0%)

Total Members Voted: 27

Author Topic: Graphics Contest 2017, please vote now!  (Read 155481 times)

bylaardt

  • Sr. Member
  • ****
  • Posts: 308
Re: Graphics Contest 2017
« Reply #120 on: July 06, 2017, 05:10:30 pm »
It's ok. It is the choice of a programmer. My opinion and yours may be divergent, but I will respect the effort to find some good reasons to support their or my when pertinent.
What would be of the evolution of science without the dialectic?

about wine:
So many security issues than i realy prefeer removing windows unit to adapt.
wine sounds like a WOP (Workaround Oriented Programming) tool.

Can i recommend install wine?
when i have a .exe and i cannot adapt/recompile it. just in this case!
« Last Edit: July 07, 2017, 02:32:55 pm by bylaardt »

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1052
    • Burdjia
Re: Graphics Contest 2017
« Reply #121 on: July 06, 2017, 09:27:05 pm »
In the midnight of your sleep you have been attacked, your teammates died unarmed. You managed to grab your sword and saved your life. You vowed to kill 100 zombies or you will never leave.

Cursed by your vow, the sky there will be forever dark. Without the bright of the sun, zombies will keep coming out.

Will you able to break the curse and continue your journey back to the palace?

It looks gorgueous.  I want to see it running. And the sources too. ;)

Well, the game is almost finished. Animations, collision detections, etc are working well. But I need background music and some sound effects.

Any suggestion where can I get some free audio that allow us to reuse?
Didn't you know about http://opengameart.org/ ?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Handoko

  • Hero Member
  • *****
  • Posts: 3759
  • My goal: build my own game engine using Lazarus
Re: Graphics Contest 2017
« Reply #122 on: July 09, 2017, 08:32:02 pm »
Hello all.
I need helps.

The Furious Paladin is basically finished. But it failed to run on my Win32 using Wine. My tests on Linux, everything seemed to work correctly.

Can you please download and test the binaries (Win32 and Linux64)? And let me know if there is something not working correctly. Criticism and suggestions are welcome.

I will provide the source code and tutorials, but not now. I need to make the code more readable before I publicize it.

The binaries, source code and tutorial later will be able to download from Allegro.pas website. But for now, you can grab the demo from:

http://graphicslearning.com/furious-paladin-tutorials/

To download, you need password: lazarus.

---edit---
This is my first time using Allegro.pas, I'm still not very sure how to correctly deploy the binaries. If you are asked to provide the allegro library, I you can try to download it from:
http://liballeg.org/download.html
« Last Edit: July 18, 2017, 07:33:16 am by Handoko »

lainz

  • Hero Member
  • *****
  • Posts: 3699
  • Leandro Diaz
Re: Graphics Contest 2017
« Reply #123 on: July 10, 2017, 01:08:17 am »
@handoko, the game runs too fast under Windows. I can't play I get killed instantly.

Handoko

  • Hero Member
  • *****
  • Posts: 3759
  • My goal: build my own game engine using Lazarus
Re: Graphics Contest 2017
« Reply #124 on: July 10, 2017, 04:02:34 am »
Thanks for informing me, I will check it.

For testing purpose, I have added some cheat codes:
/debug            -> show bounding box of the collision test
/fastrecover    -> fast health recovery
/stoneskin       -> less damage from enemies

To use that cheat codes, put it as the command parameters.
« Last Edit: July 10, 2017, 04:54:16 am by Handoko »

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: Graphics Contest 2017
« Reply #125 on: July 10, 2017, 04:22:16 am »
@Handoko
Not knowing about allegro or your ocde, i've come across this example, which should be able to time your update frequency.

Handoko

  • Hero Member
  • *****
  • Posts: 3759
  • My goal: build my own game engine using Lazarus
Re: Graphics Contest 2017
« Reply #126 on: July 10, 2017, 04:46:34 am »
Okay, thank. I will add it to the code.

Handoko

  • Hero Member
  • *****
  • Posts: 3759
  • My goal: build my own game engine using Lazarus
Re: Graphics Contest 2017
« Reply #127 on: July 10, 2017, 11:23:19 am »
I have added the timer, it now should run at the same speed on different machines. On my Linux computer, it seems to run at fixed 60 fps by default even I don't use timer and it won't able to go above it. If I set it 50 fps, I can see it runs slower, but if I set 70 or even 250, the results are the same as 60 fps.

On my system, I have liballegro5.2 and liballegro5-dev installed. That's why I have no problem compiling and running it. Not sure it is static or dynamic linked to the libraries. I found no explanation about it on Allegro.pas website. Also I don't know how to cross compile using Linux64 to produce Win32 binaries? Googling the web, the results are the complicated toolchains that I can't understand. %)

Please share some info how to build Allegro.pas games using Linux64 to produce Win32 binaries. Also, please test my demo, is it working properly or not?
http://graphicslearning.com/furious-paladin-tutorials/

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: Graphics Contest 2017
« Reply #128 on: July 10, 2017, 11:33:48 am »
I have added the timer, it now should run at the same speed on different machines. On my Linux computer, it seems to run at fixed 60 fps by default even I don't use timer and it won't able to go above it. If I set it 50 fps, I can see it runs slower, but if I set 70 or even 250, the results are the same as 60 fps.
the only reason i can think of atm is vsync/screen-mode refresh rate . Do you happen to use vsync inside your code somewhere ?

Also note that other routines could wait for vsync, flip_display() for instance (docs):
Quote
al_flip_display
void al_flip_display(void)

Source Code

Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen. Pointers to the special back buffer bitmap remain valid and retain their semantics as the back buffer, although the contents may have changed.

Several display options change how this function behaves:

  • With ALLEGRO_SINGLE_BUFFER, no flipping is done. You still have to call this function to display graphics, depending on how the used graphics system works.
  • The ALLEGRO_SWAP_METHOD option may have additional information about what kind of operation is used internally to flip the front and back buffers.
  • If ALLEGRO_VSYNC is 1, this function will force waiting for vsync. If ALLEGRO_VSYNC is 2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, and ALLEGRO_VSYNC will not be set; in this case al_flip_display will wait for vsync depending on the settings set in the system's graphics preferences.

See also: al_set_new_display_flags, al_set_new_display_option
« Last Edit: July 10, 2017, 11:40:16 am by molly »

Handoko

  • Hero Member
  • *****
  • Posts: 3759
  • My goal: build my own game engine using Lazarus
Re: Graphics Contest 2017
« Reply #129 on: July 10, 2017, 11:44:40 am »
No, my code does not contain anything related with vsync.

This is the code for drawing:

Code: Pascal  [Select][+][-]
  1. procedure ProcessDrawing;
  2. var
  3.   C: Real;
  4.   i: Integer;
  5. begin
  6.  
  7.   case AppState of
  8.  
  9.     Intro1:
  10.       begin
  11.         al_draw_bitmap(ImgIntroPage1, 0, 0, 0);
  12.         with Player do
  13.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  14.       end;
  15.  
  16.     Intro2:
  17.       begin
  18.         al_draw_bitmap(ImgIntroPage2, 0, 0, 0);
  19.         with Player do
  20.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  21.       end;
  22.  
  23.     Playing, Paused, Lose, Win:
  24.       begin
  25.         al_clear_to_color(al_map_rgb(0, 0, 10));
  26.         // Draw health bar
  27.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgb(0, 200, 0));
  28.         C := (MaxPlayerHealth-PlayerHealth)/MaxPlayerHealth;
  29.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgba_f(C, 0, 0, C));
  30.         // Show killed information
  31.         al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 20, 4,ALLEGRO_ALIGN_LEFT,
  32.           'Killed: '+IntToStr(EnemyKilled));
  33.         // Brighten the sky
  34.         al_draw_bitmap(ImgBackground1, 0, 20, 0);
  35.         C := EnemyKilled/100;
  36.         al_draw_tinted_bitmap(ImgBackground2, al_map_rgba_f(C, C, C, C), 0, 20, 0);
  37.         // Draw player and enemies
  38.         with Player do begin
  39.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  40.           if DebugMode then begin
  41.             al_draw_rectangle(PosX+35, 230, PosX+60, 280, al_map_rgb(0, 255, 0), 1);
  42.             if (CurrentActivity = AttackL) then
  43.               al_draw_rectangle(PosX+15, 230, PosX+40, 280, al_map_rgb(255, 0, 0), 1);
  44.             if (CurrentActivity = AttackR) then
  45.               al_draw_rectangle(PosX+55, 230, PosX+80, 280, al_map_rgb(255, 0, 0), 1);
  46.           end;
  47.         end;
  48.         for i := 0 to (Enemies.Count-1) do
  49.           with TActor(Enemies[i]^) do begin
  50.             al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  51.             if DebugMode then begin
  52.               if (CurrentActivity = WalkL) or (CurrentActivity = AttackL) then
  53.                 al_draw_rectangle(PosX+30, 230, PosX+65, 280, al_map_rgb(0, 0, 255), 1);
  54.               if (CurrentActivity = WalkR) or (CurrentActivity = AttackR) then
  55.                 al_draw_rectangle(PosX+33, 230, PosX+68, 280, al_map_rgb(0, 0, 255), 1);
  56.               if (CurrentActivity = AttackL) then
  57.                 al_draw_rectangle(PosX+22, 230, PosX+47, 280, al_map_rgb(255, 0, 0), 1);
  58.               if (CurrentActivity = AttackR)  then
  59.                 al_draw_rectangle(PosX+50, 230, PosX+75, 280, al_map_rgb(255, 0, 0), 1);
  60.             end;
  61.           end;
  62.         // Show cheat info
  63.         if CheatFastRecover then
  64.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 100,ALLEGRO_ALIGN_LEFT,
  65.             'FastRecover');
  66.         if CheatStoneSkin then
  67.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 120,ALLEGRO_ALIGN_LEFT,
  68.             'StoneSkin');
  69.         // AppState related
  70.         case AppState of
  71.           Paused:
  72.             al_draw_bitmap(ImgPaused, 140, 75, 0);
  73.           Lose:
  74.             al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 250, 100,
  75.             ALLEGRO_ALIGN_CENTER, 'YOU FAILED!');
  76.           Win:
  77.             al_draw_bitmap(ImgWin, 140, 75, 0);
  78.         end;
  79.       end;
  80.  
  81.   end;
  82.  
  83.   al_flip_display;
  84.  
  85. end;

And this is the main loop:

Code: Pascal  [Select][+][-]
  1. var
  2.   Event: ALLEGRO_EVENT;
  3. begin
  4.   ProcessInit;
  5.   Start(Intro1);
  6.   while (GameIsRunning) do begin
  7.     al_wait_for_event(EventQueue, Event);
  8.     ProcessUserInput;
  9.     ProcessUpdate;
  10.     ProcessDrawing;
  11.   end;
  12.   ProcessShutdown;
  13. end.
« Last Edit: July 10, 2017, 11:47:04 am by Handoko »

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: Graphics Contest 2017
« Reply #130 on: July 10, 2017, 11:57:58 am »
Thanks for the snippets, they help.

No, my code does not contain anything related with vsync.
Ah, hidden options  :)

I added to my previous post but you was quick with your response  :D

See set_new_display_option:
Quote
al_set_new_display_option
void al_set_new_display_option(int option, int value, int importance)

snip

ALLEGRO_VSYNC
Set to 1 to tell the driver to wait for vsync in al_flip_display, or to 2 to force vsync off. The default of 0 means that Allegro does not try to modify the vsync behavior so it may be on or off. Note that even in the case of 1 or 2 it is possible to override the vsync behavior in the graphics driver so you should not rely on it.

Maybe you can toy with that option a little ?

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1052
    • Burdjia
Re: Graphics Contest 2017
« Reply #131 on: July 10, 2017, 02:58:12 pm »
No, my code does not contain anything related with vsync.

This is the code for drawing:

Code: Pascal  [Select][+][-]
  1. procedure ProcessDrawing;
  2. var
  3.   C: Real;
  4.   i: Integer;
  5. begin
  6.  
  7.   case AppState of
  8.  
  9.     Intro1:
  10.       begin
  11.         al_draw_bitmap(ImgIntroPage1, 0, 0, 0);
  12.         with Player do
  13.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  14.       end;
  15.  
  16.     Intro2:
  17.       begin
  18.         al_draw_bitmap(ImgIntroPage2, 0, 0, 0);
  19.         with Player do
  20.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  21.       end;
  22.  
  23.     Playing, Paused, Lose, Win:
  24.       begin
  25.         al_clear_to_color(al_map_rgb(0, 0, 10));
  26.         // Draw health bar
  27.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgb(0, 200, 0));
  28.         C := (MaxPlayerHealth-PlayerHealth)/MaxPlayerHealth;
  29.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgba_f(C, 0, 0, C));
  30.         // Show killed information
  31.         al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 20, 4,ALLEGRO_ALIGN_LEFT,
  32.           'Killed: '+IntToStr(EnemyKilled));
  33.         // Brighten the sky
  34.         al_draw_bitmap(ImgBackground1, 0, 20, 0);
  35.         C := EnemyKilled/100;
  36.         al_draw_tinted_bitmap(ImgBackground2, al_map_rgba_f(C, C, C, C), 0, 20, 0);
  37.         // Draw player and enemies
  38.         with Player do begin
  39.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  40.           if DebugMode then begin
  41.             al_draw_rectangle(PosX+35, 230, PosX+60, 280, al_map_rgb(0, 255, 0), 1);
  42.             if (CurrentActivity = AttackL) then
  43.               al_draw_rectangle(PosX+15, 230, PosX+40, 280, al_map_rgb(255, 0, 0), 1);
  44.             if (CurrentActivity = AttackR) then
  45.               al_draw_rectangle(PosX+55, 230, PosX+80, 280, al_map_rgb(255, 0, 0), 1);
  46.           end;
  47.         end;
  48.         for i := 0 to (Enemies.Count-1) do
  49.           with TActor(Enemies[i]^) do begin
  50.             al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  51.             if DebugMode then begin
  52.               if (CurrentActivity = WalkL) or (CurrentActivity = AttackL) then
  53.                 al_draw_rectangle(PosX+30, 230, PosX+65, 280, al_map_rgb(0, 0, 255), 1);
  54.               if (CurrentActivity = WalkR) or (CurrentActivity = AttackR) then
  55.                 al_draw_rectangle(PosX+33, 230, PosX+68, 280, al_map_rgb(0, 0, 255), 1);
  56.               if (CurrentActivity = AttackL) then
  57.                 al_draw_rectangle(PosX+22, 230, PosX+47, 280, al_map_rgb(255, 0, 0), 1);
  58.               if (CurrentActivity = AttackR)  then
  59.                 al_draw_rectangle(PosX+50, 230, PosX+75, 280, al_map_rgb(255, 0, 0), 1);
  60.             end;
  61.           end;
  62.         // Show cheat info
  63.         if CheatFastRecover then
  64.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 100,ALLEGRO_ALIGN_LEFT,
  65.             'FastRecover');
  66.         if CheatStoneSkin then
  67.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 120,ALLEGRO_ALIGN_LEFT,
  68.             'StoneSkin');
  69.         // AppState related
  70.         case AppState of
  71.           Paused:
  72.             al_draw_bitmap(ImgPaused, 140, 75, 0);
  73.           Lose:
  74.             al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 250, 100,
  75.             ALLEGRO_ALIGN_CENTER, 'YOU FAILED!');
  76.           Win:
  77.             al_draw_bitmap(ImgWin, 140, 75, 0);
  78.         end;
  79.       end;
  80.  
  81.   end;
  82.  
  83.   al_flip_display;
  84.  
  85. end;

And this is the main loop:

Code: Pascal  [Select][+][-]
  1. var
  2.   Event: ALLEGRO_EVENT;
  3. begin
  4.   ProcessInit;
  5.   Start(Intro1);
  6.   while (GameIsRunning) do begin
  7.     al_wait_for_event(EventQueue, Event);
  8.     ProcessUserInput;
  9.     ProcessUpdate;
  10.     ProcessDrawing;
  11.   end;
  12.   ProcessShutdown;
  13. end.
I'm really curious about your sources.  Your game loop looks as the loops used in the old times, when the target system had a fixed speed (i.e: game consoles, z80 based computers, ect.).  Nowadays a single target (i.e. PC) may have different speed (not only CPU but also memory, disk and graphics hardware, that affects the final speed).  Of course, it is possible to control speed using different ways, and I'm curious to know which one you've used as I'm sure it's very different to the one I'm using in my engine.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

minesadorada

  • Hero Member
  • *****
  • Posts: 605
  • Retired
Re: Graphics Contest 2017
« Reply #132 on: July 10, 2017, 03:07:38 pm »
Can you please download and test the binaries (Win32 and Linux64)? And let me know if there is something not working correctly. Criticism and suggestions are welcome.
When running the EXE on Win 10 x64, it asks for various DLLs then quits.
allegro_image-5.2.dll
allegro_ttf-5.2.dll
allegro_font-5.2.dll
allegro-5.2.dll

HTH
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

Scoops

  • Jr. Member
  • **
  • Posts: 89
Re: Graphics Contest 2017
« Reply #133 on: July 10, 2017, 04:52:56 pm »
@minesadorada

I also got these missing dll errors
I downloaded from https://github.com/liballeg/allegro5/releases
Version 5.2 im on Windows XP 32bit sp3 and "allegro-mingw-gcc5.3.0-x86-5.2.0.zip" contained
all the dlls needed to run the Game.
if you are 64bit try "allegro-mingw-gcc5.3.0-x64-5.2.0.zip" ?

Hope this helps
« Last Edit: July 10, 2017, 04:54:28 pm by Scoops »

lainz

  • Hero Member
  • *****
  • Posts: 3699
  • Leandro Diaz
Re: Graphics Contest 2017
« Reply #134 on: July 10, 2017, 05:21:58 pm »
For Ubuntu I downloaded the PPA containing 5.2 and the game runs fine.

For Wine I downloaded the 5.2.0 dll and put into the exe folder, then run with Wine and works fine also. If you download a newer version like 5.2.x there are more dependencies that doesn't come with Windows, something related with C++. These DLL doesn't come with the Allegro download, must be downloaded in another place.

 

TinyPortal © 2005-2018