Recent

Author Topic: xTactics turn-based strategy game  (Read 7487 times)

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
xTactics turn-based strategy game
« on: July 07, 2017, 08:35:49 pm »
https://app.zdechov.net/xtactics/
xTactics is turn-based world domination strategy game inspired by classic Risk board game. Game map is randomly generated with adjustable parameters. Also various game rules can be changed. Multiple computer or human opponents can be chosen. You can let computer players fight each other.
It is developed in Lazarus/FPC.
You can download source files, Windows installer or deb package for Ubuntu/Debian.

The game is still unfinished and several interesting features yet to be implemented but latest release 1.1.0 is playable.
« Last Edit: December 18, 2018, 11:39:22 pm by Chronos »

Handoko

  • Hero Member
  • *****
  • Posts: 5386
  • My goal: build my own game engine using Lazarus
Re: xTactics turn-based strategy game
« Reply #1 on: July 07, 2017, 08:38:45 pm »
The image xTactics.png you provided cannot be opened on my Ubuntu PC.

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
Re: xTactics turn-based strategy game
« Reply #2 on: November 19, 2017, 02:09:25 pm »
New version released with various fixes and small improvements.

Quote
Version 1.2.0 (2017-11-19)
==========================

* Added: Remember players configuration for new game.
* Added: Map can have rounded shape.
* Added: New Unit moves window available from Tools menu.
* Modified: Improved code for symmetric map generation.
* Modified: Store player settings for new game separately to current game players.
* Modified: Implemented better algorithm for initialization of players start cell to maintain minimal distance between players.
* Modified: Do not create settings form on application start but just if form is opened.
* Modified: Improved attack to neutral units if computer have more units available when necessary.
* Fixed: Show error message if not all players were placed to the map.
* Fixed: Build cell bridges correctly if symmetric map is selected.
* Fixed: Avoid possible negative cell power if player unit was previously unsuccessfully attacked and weaken by enemy.
* Fixed: Same game structures were not correctly initialized during load from file.
* Fixed: Show other players cells with normal power and cells of current player with power lowered by unit moves.
* Fixed: Problems with freeing memory of unit moves.

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
Re: xTactics turn-based strategy game
« Reply #3 on: September 23, 2018, 08:57:57 pm »
After a while a new version with many new features is available for download from https://app.zdechov.net/xtactics/.

Quote
Version 1.3.0 (2018-09-22)
==========================

* Added: Menu icons for players stats, keyboard shortcuts, and help.
* Added: Full screen mode.
* Added: Limit minimum and maximum map zoom.
* Added: Support for color themes (system, dark, light).
* Added: Remember dimensions for more application forms.
* Added: Support for cyclic map. Movement across map borders will take player units to opposite map border. Show map multiple times side by side to simulate infinite world.
* Added: Show number of captured win objective cells in players stats and graphs.
* Added: Remember last opened tab in New game form.
* Added: New window to list all available actions with their keyboard shortcuts.
* Added: Save action to save game without opening save dialog.
* Added: New objective "Capture all special cells" is now functional. Number of such cells can be specified. They are randomly spread across map and such cells are marked with "!" symbol after its number of units.
* Added: Evaluate win objection to stay alive for defined number of turns. Multiple players can win.
* Added: Settings option to automatically reopen last saved game on application start.
* Added: Configurable game parameter maximum units per cell.
* Added: Isometric map type.
* Added: Sorting by table columns in players stats form.
* Added: Popup menu action Spectate in Players stats window.
* Added: New window with players statistics.
* Added: Allow to open other spectator client windows.
* Added: A preparation for gameplay over network. Internal separation of client and server part of game core.
* Added: Voronoi map type which generate random mesh type maps.
* Modified: Initial game setting made independent to current game settings. So last game can be automatically loaded on start and initial setting will be intact.
* Modified: Allow multiselect and removal of players in new game dialog.
* Modified: Draw only visible arrows between cells.
* Fixed: Force directory creation only if directory is specified on game save.
* Fixed: An error on drawing of vertical unit move arrow.
* Fixed: Store map type in saved game files.
* Fixed: Load and start new game after main form is shown so cells can be correctly zoomed to be visible all.
* Fixed: Application settings wasn't saved if the application was exited by main menu action Exit.
* Fixed: Computer was affecting player cells by its cell moves.
* Fixed: Open/Save dialog with file filter and initial directory and name from current game.
* Fixed: Generate map only once on application start.
* Fixed: Do not generate map twice on map config load.
« Last Edit: January 06, 2025, 03:42:36 pm by Chronos »

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
Re: xTactics turn-based strategy game
« Reply #4 on: January 06, 2025, 03:28:49 pm »
A new version 1.4.0 was released with new features and bugfixes. https://app.zdechov.net/xtactics/
The game is now available as both Flatpak https://flathub.org/apps/net.zdechov.app.xTactics and Snap https://snapcraft.io/xtactics
Also available from https://chronoscz.itch.io/xtactics

Quote
Version 1.4.0 (2025-01-04)
==========================

* Added: Added vector logo and generated raster logo with resolution 256x256.
* Added: Close button on more forms for better touch screen devices support.
* Added: Game systems action in Tools menu.
* Added: Allow to add building kinds to game system.
* Added: Allow to manage nations for each game system.
* Added: New map type hexagonal horizontal.
* Added: Limit allowed map type according selected game system.
* Added: Allow to load/save game system from/to file system as .xts file.
* Added: Allow to move units instantly during turn.
* Added: Game system parameter to play without possibility to merge/split units.
* Added: Show units shape to see in which cell units are placed.
* Added: Delete button to unit move dialog.
* Added: Map random preview in New game form.
* Added: New menu action show/hide map grid lines.
* Added: New win objective None to just play freely without any win objective.
* Added: New win objective to capture entire map.
* Added: New game systems to represent various game play systems of other existing games.
* Added: New game option to set cells without player units as neutral.
* Modified: Improved data directories detection.
* Modified: OK button moved to be on the left side of buttons.
* Modified: Added more action icons to main toolbar and main menu.
* Modified: Do not paint new game preview bellow form height.
* Modified: Automatically save running game on application exit and reopen it on next start.
* Modified: Show icons in shortcuts window.
* Modified: Improved dark theme support on Windows.
* Modified: End turn with space key.
* Modified: Allow to set nation in player settings.
* Modified: Allow to have only one player in the game.
* Modified: Set new created players as computer.
* Modified: Maximum number of player set to 12.
* Modified: Do not zoom all on new game start and game load from file.
* Modified: Allow to resize new game, settings and game system forms to be smaller with scroll box area.
* Modified: Use new higher resolution application image in about dialog.

nomorelogic

  • Full Member
  • ***
  • Posts: 172
Re: xTactics turn-based strategy game
« Reply #5 on: January 08, 2025, 12:50:00 pm »
hi Chronos
compiling from trunk using Lazarus 3.6, I get following error

Code: Pascal  [Select][+][-]
  1. procedure TListViewSort.Sort(Compare: TCompareEvent);
  2. begin
  3.   // TODO: Because TFLGObjectList compare handler is not class method,
  4.   // it is necessary to use simple function compare handler with local variable
  5.   ListViewSortCompare := Compare;
  6.   if (List.Count > 0) then
  7.     List.Sort(TComparer<TObject>.Construct(ListViewCompare));  // <----- error line
  8. end;
  9.  

Quote
ListViewSort.pas(351,59) Error: Incompatible type for arg no. 1: Got "ListViewCompare(constref TObject;constref TObject):LongInt;", expected "<procedure variable type of function(const TObject;const TObject):LongInt;Register>"

Thanks for suggestions.



TRon

  • Hero Member
  • *****
  • Posts: 3810
Re: xTactics turn-based strategy game
« Reply #6 on: January 08, 2025, 01:43:48 pm »
1.4.0 compiles and works for me (quick test with FPC 3.2.2 and Laz 3.4).

Trunk crashes for me when trying to load the main project file (which seem strange because I did not see any updated lfm files so quickly).

@nomorelogic:
That code should compile with mode Delphi
I do not have to remember anything anymore thanks to total-recall.

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
Re: xTactics turn-based strategy game
« Reply #7 on: January 08, 2025, 03:07:44 pm »
Both trunk and 1.4.0 compiles for me on various platforms where different Lazarus versions are available. I use Lazarus 3.6 on my workstation. And there method with constref parameter is required according to the FPC file generics.defaults.pas:
Quote

  TOnComparison<T> = function(constref Left, Right: T): Integer of object;
  TComparisonFunc<T> = function(constref Left, Right: T): Integer;

  TComparer<T> = class(TInterfacedObject, IComparer<T>)
  public
    class function Default: IComparer<T>; static;
    function Compare(constref ALeft, ARight: T): Integer; virtual; abstract; overload;

    class function Construct(const AComparison: TOnComparison<T>): IComparer<T>; overload;
    class function Construct(const AComparison: TComparisonFunc<T>): IComparer<T>; overload;
  end;
That constref thing was changed in recent versions of Lazarus/FPC. Is it possible that your version is somehow not clean? Do you run it on Windows or Linux? Can you verify build with clean Lazarus and FPC? Also check that that the lazarus configuration is correct as it might point to the older locations or FPC and other components.

Mode delphi is set in the project file so it is set by default for all .pas files in the project.
Trunk and 1.4.0 version are pretty close right now as I did just bug hunting & fixing and no new development was done yet.

Jonax

  • New Member
  • *
  • Posts: 22
Re: xTactics turn-based strategy game
« Reply #8 on: January 08, 2025, 03:57:42 pm »
Hi Chronos.

I'm pleased to report the .deb file installs and runs on my virtual AMD64/Debian . I haven't tried the actual gameplay but it generates various maps without problem.

Keep up the good work!

nomorelogic

  • Full Member
  • ***
  • Posts: 172
Re: xTactics turn-based strategy game
« Reply #9 on: January 08, 2025, 04:26:33 pm »
thank you all for helping me

First I would share some details abount my setup
  • I'm working on Linux (devuan)
  • can confirm Delphi mode is on
  • lazarus(3.6)/fpc (3.2.3) installed using fpcupdeluxe

As I understand, in fpc 3.2.2 sources, TOnComparison is defined as
Code: Pascal  [Select][+][-]
  1. TOnComparison<T> = function(constref Left, Right: T): Integer of object;

in fpc 3.2.3 sources I can found "const"
Code: Pascal  [Select][+][-]
  1. TOnComparison<T> = function(const Left, Right: T): Integer of object;

Now using fpc 3.2.2 to compile your project, all goes well .

thanks
« Last Edit: January 08, 2025, 04:30:22 pm by nomorelogic »

 

TinyPortal © 2005-2018