Published: Formula Speed - tabletop car racing

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Published: Formula Speed - tabletop car racing

Post by togFox »

speed.png
speed.png (148.33 KiB) Viewed 1254 times
Formula Speed - a turn-based racing car board game

Select your gear, roll the dice, move your car, negotiate the corners - win!

Instructions

choose a gear in the bottom-right corner

right-click your car forward one square at a time until all your moves are exhausted

go to step 1 :)

grid.png
grid.png (176.14 KiB) Viewed 1254 times
Controls

Use left mouse button to select a gear.

Use right moust button to select a cell in front of the race car.

Hold milddle-mouse-button to move the camera.

Use arrow keys to move the camera. ( <- ^ -> v )

Use shift-arrow keys to move the camera faster.

Use mouse-wheel to zoom in and out.

Use -/= to zoom in and out.

track.jpg
track.jpg (1.66 MiB) Viewed 1254 times
Editor

Contains in-game editor that lets you change the track. Click 'e' to enter editor mode:

click any cell to highlight it

use mouse wheel to rotate a cell

right-click-drag between two cells to create a link (pathway). DIRECTION IS IMPORTANT

repeat the right-click-drag between two cells to remove the link

'delete' key will remove a cell

'c' key marks a cell as a corner. Do this for every cell in the corner.

's' key sets the speed/stops on the corner. Do this for every cell in the corner.

'f' key will mark the cell as a finish line

'n' will add a new cell at the current mouse position

'l' will add a new cell at the current mouse position AND link it to the previous cell

'SHIFT-S' will save the track

career.png
career.png (11.31 KiB) Viewed 1254 times
Artificial intelligence - machine learning

The bots are not hand scripted or coded. They are genuine machine-learning bots. They start with limited intelligence and learn over time. The more you play, the more they learn. As the bots learn, their knowledge and understanding of the track increases.

Hold the 'k' key to see the heatmap for the track as the bots understand it. Red cells show where the bots think they need to slow down. Yellow and blue cells show where the bots think they need to speed up. This heatmap is constantly evolving and improving. With enough time, the bots will form a perfect heatmap to guide their decision making.
gearbox.png
gearbox.png (48.59 KiB) Viewed 1254 times

trophy.png
trophy.png (81.52 KiB) Viewed 1254 times
gears.png
gears.png (43.77 KiB) Viewed 1254 times



title_630x343.png
title_630x343.png (287.06 KiB) Viewed 1254 times
Windows link on itch (preferred): https://togfox.itch.io/formula-speed

Love file:
FormulaSpeed.love
(6.46 MiB) Downloaded 59 times
WARNING: uses nativefs to save in non-standard folders. Might not work on every OS

Thanks to darkfrei for always being so helpful
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: Published: Formula Speed - tabletop car racing

Post by pgimeno »

As I click on "Restart career", I get this:

Code: Select all

No track found. Providing starting cell.
No track knowledge found.
Error: race.lua:339: attempt to get length of global 'trackknowledge' (a nil value)
stack traceback:
	[love "boot.lua"]:345: in function '__len'
	race.lua:339: in function 'loadRaceTrack'
	race.lua:1744: in function 'update'
	main.lua:172: in function 'update'
	[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
	[C]: in function 'xpcall'
User avatar
darkfrei
Party member
Posts: 1178
Joined: Sat Feb 08, 2020 11:09 pm

Re: Published: Formula Speed - tabletop car racing

Post by darkfrei »

File FormulaSpeed.love
Pressed "Restart career"
error:

Code: Select all

Error

race.lua:339: attempt to get length of global 'trackknowledge' (a nil value)


Traceback

race.lua:339: in function 'loadRaceTrack'
race.lua:1744: in function 'update'
main.lua:172: in function 'update'
[C]: in function 'xpcall'
2023-04-24T09_26_13-NVIDIA GeForce Overlay DT.png
2023-04-24T09_26_13-NVIDIA GeForce Overlay DT.png (11.3 KiB) Viewed 1242 times
Tested with:

Code: Select all

		if trackknowledge then
			print("Knowledge size = " .. #trackknowledge)
		end
1. Please make the movement with the left mouse button; the right mouse button can be used to move the map.
2. Please highlight the gearbox when the player MUST change/choose the gear. At the start I can click just brakes and not gear was chosen. Also highlight the possible options for the control, make not possible gears as gray, make the dangerous gears as red backlight.
3. After the gear was chosen, make highlighting of possible movements (as step-by-step movement) and end positions (as start-to end movement).
4. The score must be shown in game, and show the AI movements after the player finishing.
5. Add names to AI players and "Player" as player's name :)
Attachments
2023-04-24T09_44_19-Speed 1.0.png
2023-04-24T09_44_19-Speed 1.0.png (473.04 KiB) Viewed 1231 times
Last edited by darkfrei on Mon Apr 24, 2023 8:18 am, edited 4 times in total.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Published: Formula Speed - tabletop car racing

Post by togFox »

WARNING: uses nativefs to save in non-standard folders. Might not work on every OS

I'm guessing you're not MS Windows. If true then that proves the OS compatibility in a definitive way. Thanks for trying. :(

edit: my target audience is MS Windows on itch.io but if mac and unix/linux users no the correct way to use nativefs then I'm all ears.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
BrotSagtMist
Party member
Posts: 613
Joined: Fri Aug 06, 2021 10:30 pm

Re: Published: Formula Speed - tabletop car racing

Post by BrotSagtMist »

Why again are you even saving non standard?

Also big booooo for having a target audience, but then again i usually make sure my crap doesnt work on windows ¯\_(ツ)_/¯
obey
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: Published: Formula Speed - tabletop car racing

Post by pgimeno »

It's not about nativefs compatibility across OSes. It's about this:

Code: Select all

    savedir = love.filesystem.getSourceBaseDirectory()
    if love.filesystem.isFused() then
        savedir = savedir .. "\\savedata\\"
    else
        savedir = savedir .. "/FormulaSpeed/savedata/"
    end
First, never use backslashes for files; it works just fine with normal slashes in all currently supported systems. Second, nativefs won't work with files inside a .love file (in any OS), but you can tell people to unpack the .love file and run the directory, if you use this instead:

Code: Select all

    -- set the folders based on fused or not fused
    if love.filesystem.isFused() then
        savedir = love.filesystem.getSourceBaseDirectory() .. "/savedata/"
    else
        savedir = love.filesystem.getSource() .. "/savedata/"
    end
There's a typo in the itch.io filename, by the way.
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: Published: Formula Speed - tabletop car racing

Post by pgimeno »

Update after a (somewhat heated) discussion on IRC:

Using nativefs in this case is not really granted. Your game could reach a wider audience if it uses the regular save directory provided by Löve. You just need to pack the .love file with a data directory containing the initial files, and if they don't exist in the save directory, copy them from source to save. That is as simple as this:

Code: Select all

    if not love.filesystem.getInfo('knowledge.dat') then
        local data = love.filesystem.read("savedata/knowledge.dat")
        love.filesystem.write("knowledge.dat", data)
        data = love.filesystem.read("savedata/racetrack.dat")
        love.filesystem.write("racetrack.dat", data)
    end
then continue using the regular save directory. Under Linux or MacOS, you can even make 'savedata' a symlink to the save folder, to ease the packaging. That's more difficult on Windows as far as I know.

But there are use cases for having the program and data in the same folder. That should be an option, though (e.g. an extra "portable app" download) and not the default.

The discussion on IRC was about how to organize this portable app mode. It's not so easy to check if you're running from a directory or from a .love file, which you have to do if you want to have the data inside the directory in the first case and together with the .love file in the second case. People on IRC disagreed about this organization being a good idea in the first place.

For this use case, you should not provide just a .love file, but a .zip file containing both the .love file and the data directory, similar to how you distribute them in itch.io.
Post Reply

Who is online

Users browsing this forum: No registered users and 68 guests