Coder Social home page Coder Social logo

suomipelit / ultimatetapankaikki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hkroger/ultimatetapankaikki

36.0 7.0 7.0 6.23 MB

Open source port of Ultimate Tapan Kaikki

License: GNU General Public License v3.0

C++ 85.56% C 6.27% CMake 1.42% Python 0.77% Shell 0.58% HTML 1.79% JavaScript 3.62%
sdl2 game shooter retrogaming emscripten port online-game singleplayer multiplayer

ultimatetapankaikki's Introduction

Ultimate Tapan Kaikki

Build Downloads Latest release

Ultimate Tapan Kaikki GIF

Try live browser version here!

๐Ÿ‘‰ The original README.TXT can be found as README.ORIG.TXT.

This is the legendary 90s game Ultimate Tapan Kaikki, ported to SDL2. It runs at least on macOS, Linux, FreeBSD and Windows.

See also the Level Editor for Ultimate Tapan Kaikki project.

Key bindings

Player 1 and 2 game controls can be customized under OPTIONS -> PLAYER OPTIONS -> DEFINE KEYS 1/2.

Game controllers are also supported but buttons need to be configured in options before playing. No more than two controllers are recognized at the same time. Analog inputs or navigating in menus is not currently supported.

Other than player keys are hard-coded.

Note: Some Apple keyboards don't have a right ctrl key. If you have such a keyboard, you have to change the player 1 shoot key before playing.

Moving in menus

Key Description
Up/down arrow Navigate
Return Select
Esc Go back

Player 1 game controls

Key Description
Up arrow Move forward
Down arrow Move backward
Left arrow Turn counter clockwise
Right arrow Turn clockwise
Right ctrl Shoot
Right shift Change weapon
Right alt Strafe
, Starfe left
. Starfe right

When playing solo, you can use grave (left of 1), 1 ... 9, 0, and minus (right of 0) to select the corresponding weapon. Grave selects fist, 1 selects pistola, 2 selects shotgun, etc.

Player 2 game controls

Key Description
w Move forward
s Move backward
a Turn counter clockwise
d Turn clockwise
Tab Shoot
Caps Lock Change weapon
Grave Strafe
1 Starfe left
2 Starfe right

Miscellaneous game controls

Key Description
Esc, then y Quit game
Space Toggle map
F5 Toggle frame rate
F12 Capture screen shot
Left alt + Return Toggle full screen
Return Text chat (multiplayer only)

Shop controls

Key Description
Arrow keys Switch between items
Shoot key Buy
Switch weapon key Sell
Esc, then shoot key Exit shop
Shift + Esc Exit game immediately

Differences compared to the original game

This port is based on hkroger's published original sources at https://github.com/hkroger/ultimatetapankaikki. Those sources are for v1.2 beta, whereas the latest published version of the game is v1.21, also called TK321 (the released zipfile's name was TK321.zip).

We've fixed all the bugs and differences between v1.2 beta and v1.21.

Changes required to port the game:

  • When starting the game, it runs in a window. You can change to full screen and with left alt + return.

  • Networking on native versions is now based on TCP/IP, originally it used IPX. When joining a network game, there's a new screen that allows typing the server address. Port is 8099.

  • Networking on web version is based on WebRTC. All currently active games are visible in server list. List is provided by lobby server.

  • In-game screenshots are saved in BMP format as opposed to original PCX format.

New features:

  • Pressing Esc in episode selection menu goes back to main menu.

  • Pressing Shift + Esc anywhere in the game quits immediately.

  • Game controller support.

  • Setting the environment variable TK_MUTE_MUSIC mutes all music. Useful if you like your Tapan Kaikki with your favorite mixtape.

  • You can use the -e command line parameter to immediately jump into single-player game in the given episode. This works with the -l switch too. Mostly useful for development, of course.

  • Setting the environment variable TK_SKIP_LEVEL_INFO will skip the screen that appears at the start of each level. Useful for impatient developers.

  • Name is not cleared if pressing ESC in name prompt.

  • Player name is prompted if starting or joining to network game with default name.

  • Text chat in multiplayer games with Return key.

  • Text input fields support copy-paste (Ctrl + c/v)

  • Number of players on a server is shown on server list

  • Online game name can be set in multiplayer options. It defaults to player name.

Bugfixes:

  • Many memory leaks and buffer overflows have been fixed.

  • Many places in menus caused a high CPU load because of busy loops waiting for something. These have been fixed.

  • Fixed player name changing to only accepts a-z and 0-9, space and .. Originally it accepted any keypress and produced a space for characters not available in the font.

  • Clients now monitor server connection and quit to main menu if the server crashes.

  • Player names and colors were mixed up in split screen mode.

  • Empty player name is not allowed.

Building from source

Requirements:

  • CMake
  • C++ compiler: At least gcc, clang and Visual Studio are supported
  • Libraries: SDL2, SDL2_mixer, SDL2_image, SDL2_net
    • On macOS, you can install these with Homebrew. brew install sdl2 sdl2_mixer sdl2_image sdl2_net
    • On Windows you can download these from SDL website

Building:

cmake .
cmake --build .

On Window, this produces GAME.EXE which you can run. On other systems, the name of the executable is tk3.

On Windows, you may need to explicitly specify paths to your SDL libraries, like

cmake -DSDL2_PATH="C:\\<path>\\SDL2-2.0.9" -DSDL2_MIXER_PATH="C:\\<path>\\SDL2_mixer-2.0.4" -DSDL2_IMAGE_PATH="C:\\<path>\\SDL2_image-2.0.4" -DSDL2_NET_PATH="C:\\<path>\\SDL2_net-2.0.1" .

which produces project files for 32-bit target. For 64-bit target, use e.g. cmake -G "Visual Studio 15 2017 Win64".

On browser:

Emscripten JavaScript/WebAssembly build for browsers is also supported. You can try it live here.

emcmake cmake .
cmake --build .

For best performance it is recommended to build with -DCMAKE_BUILD_TYPE=Release.

It might be easiest to run local HTTP server with Python

python -m http.server

and opening the game with supported browser at http://localhost:8000/ultimatetapankaikki.html.

Building releases

  • Linux: Run ./pkg/build-deb.sh to build a .deb (Docker is required)
  • Windows: TBD (probably using cpack somehow)
  • macOS: Run ./pkg/build-macos.sh to build a .dmg

Releases

Version 3 - 2020-11-08

Network game not compatible with version 2!

  • Web port
  • Network gaming changes
    • Text chat with Return key
    • Fixed joining with cooperative mode as active
    • Fixed kill messages
    • Fixed frag count in some cases
    • Fixed missing smoke and spot light effects on clients
    • Increased network code execution frequency
    • Show number of players on server list
    • Reduced keep-alive messages
    • Add game name option to multiplayer options
  • Fixed a memory leak in sound resampling
  • Fixed minor buffer overflow with sprite loading
  • Fixed a local deathmatch crash if playing with enemies
  • Fixed empty name input
  • Avoid unnecessary screen drawing
  • Copy-paste support to text input fields

Version 2 - 2019-02-04

  • Fixed bug #131: Small sprites (crosshair, bomb, mine) were not being visible in the port. They worked fine in the original version.

Version 1 - 2019-01-28

  • Initial release

ultimatetapankaikki's People

Contributors

akheron avatar akx avatar emlai avatar hkroger avatar juj avatar veikkos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ultimatetapankaikki's Issues

Network deathmatch game allows enemies

Enemies over network is not a supported feature of TK321. Original game doesn't allow enabling enemies on network game. That UI block has been implemented after 1.2 beta which we are working on.

enemies-on-network

Window close button only works in main menu

Pressing window close button (top right corner on most of the systems) only works in main menu. If pressed in other context, the application only closes when returning to main menu.

Implement audio resampling

#15 implements basic audio support, but resampling sounds (which is heavily used by TK) is not supported.

All sounds play at equal pitch right now, and thus don't sound original.

Game controller support

Support game controllers in subtle way. Only place that probably needs to stand out from original game is the key changing view where Joy 1 Up etc. should be recognized.

Some buttons probably need to be hard-coded to certain buttons, like keyboard keys ESC, N and Y, ENTER, UP and DOWN so that menus, shop etc. work without keyboard interference. (Will be implemented separately.)

Could support two controllers for coop.

Display surface missing locking

Display surface missing locking. surface should be locked while game logic is updating the content and unlocked for rendering. It would guarantee that the pixel data pointer is valid. It happens to work without locking for now but it might break on any SDL update or on some new platform.

See SDL_LockSurface.

Windows executable name should be GAME.EXE

Original game executable is "GAME.EXE" as opposed to "tk3.exe".

For non-Windows systems it might be beneficial to keep the name as tk3 so that it works well with packaged game.

Cannot repeat non-symbol keys by holding down

Useful e.g. in the shop to buy many bullets if your fire key is bound to e.g. ctrl or alt.

I think we need to convert the keyboard handling to use SDL_GetKeyboardState to achieve this, because SDL doesn't generate key repeat events for these keys.

High CPU load

CPU load is high especially in menus and while game is in background.

utk_cpu_load
(Sorry about language.)

CMake flags to speficy custom paths for game data and user options

This would make it possible to package rhe game for different systems. E.g. data to /usr/share, options to $HOME/.

Options should be read and written to options directory, and if they don't exist, then from game data directory.

Also add support for make install.

FPS is 38-39 instead of target 40

SDL timers are not millisecond accurate. Based on quick analysis with SDL's own SDL_GetTicks, the expected 25 ms callback is actually usually 26 ms leading to ~5% error which seems to match the expexted error.

Network game issues

Can be splitted to several issues if needed.

  • Client joining while "Cooperative" (instead of "Deathmatch") mode is selected breaks the game
    • Force "Deathmatch" while client is joining a game
    • Fixed in #148
  • Messages not propagated correctly (kill messages as least)
    • Messages to clients missing
    • Host getting double notification
  • Holding the game (e.g. dragging window) can lead client timeout (expected) but only partial "reconnect"
    • Disconnect entirely on server side or propagate re-joining to other clients (#153)
  • Smoke not visible for clients (bug or feature?)

Keybindings in OPTIONS.CFG are not the same as in original

Keys: forward, backward, turn counter clockwise, turn clockwise, shoot, change weapon, strafe, strafe left, strafe right.
Player 1: up, down, left, right, ctrl, shift, alt gr, comma, period
Player 2: w, s, a, d, tab, caps lock, `, 1, 2

Player name left empty

If escaping from name selection (instead of Enter), name is set to empty. Previously set name should be kept.

Network clients don't monitor server connection

Issue is in original TK code, not in the port.

Clients should probably check socket status (similarly like server polls accept_connections for new connections) to check if server connection is still open. If not, client should e.g. quit to main menu.

Issue does not affect servers shutting down on purpose, since server sends SERVERSHUTDOWN which clients handle correctly.

heap-buffer-overflow in check_place

==90928==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61c00000e860 at pc 0x000100059f00 bp 0x7ffeefbfe9c0 sp 0x7ffeefbfe9b8
READ of size 4 at 0x61c00000e860 thread T0
atos(90936,0x1000c95c0) malloc: enabling scribbling to detect mods to free blocks
    #0 0x100059eff in check_place(int, int, int) GAME.CPP:267
    #1 0x10005b24d in place_normal_game_crates() GAME.CPP:329
    #2 0x100069f67 in game() GAME.CPP:2316
    #3 0x10006c536 in menu() GAME.CPP:2481
    #4 0x10006d218 in main GAME.CPP:2598
    #5 0x7fff5d755084 in start (libdyld.dylib:x86_64+0x17084)

0x61c00000e860 is located 32 bytes to the left of 1904-byte region [0x61c00000e880,0x61c00000eff0)
allocated by thread T0 here:
    #0 0x1009b4f53 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x56f53)
    #1 0x7fff306ace65 in -[__NSArrayM insertObject:atIndex:] (CoreFoundation:x86_64h+0x2ce65)
    #2 0x7fff306e52d1 in ___CFBundleReadDirectory_block_invoke (CoreFoundation:x86_64h+0x652d1)
    #3 0x7fff306a528e in _CFIterateDirectory (CoreFoundation:x86_64h+0x2528e)
    #4 0x7fff306e50b1 in _CFBundleReadDirectory (CoreFoundation:x86_64h+0x650b1)
    #5 0x7fff306e4b86 in _createQueryTableAtPath (CoreFoundation:x86_64h+0x64b86)
    #6 0x7fff306e4102 in _copyQueryTable (CoreFoundation:x86_64h+0x64102)
    #7 0x7fff306e397e in _copyResourceURLsFromBundle (CoreFoundation:x86_64h+0x6397e)
    #8 0x7fff306e32d8 in _CFBundleCopyFindResources (CoreFoundation:x86_64h+0x632d8)
    #9 0x7fff306e8382 in CFBundleCopyResourceURL (CoreFoundation:x86_64h+0x68382)
    #10 0x7fff306f56f9 in _copyStringFromTable (CoreFoundation:x86_64h+0x756f9)
    #11 0x7fff306f5376 in CFBundleCopyLocalizedStringForLocalization (CoreFoundation:x86_64h+0x75376)
    #12 0x7fff2e558464 in _NSLocalizedServiceBundleString (AppKit:x86_64+0x961464)
    #13 0x7fff2df64d88 in -[_NSServiceEntry localizedTitle] (AppKit:x86_64+0x36dd88)
    #14 0x7fff2df64bba in -[_NSServiceEntry menuItemTitle] (AppKit:x86_64+0x36dbba)
    #15 0x7fff2df644df in __copySortedEntries_block_invoke (AppKit:x86_64+0x36d4df)
    #16 0x7fff5d800ed6 in _qsort (libsystem_c.dylib:x86_64+0x5fed6)
    #17 0x7fff2df642a2 in -[_NSServicesMenuUpdater insertServicesIntoMenu:withKeyEvent:isForDisplay:] (AppKit:x86_64+0x36d2a2)
    #18 0x7fff2df6415f in -[_NSServicesMenuUpdater updateMenu:withEvent:withFlags:] (AppKit:x86_64+0x36d15f)
    #19 0x7fff2df37f1c in -[_NSServicesPrincipalMenuUpdater updateMenu:withEvent:withFlags:] (AppKit:x86_64+0x340f1c)
    #20 0x7fff2de19c57 in -[NSMenu _populateWithEventRef:] (AppKit:x86_64+0x222c57)
    #21 0x7fff2df364e1 in -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] (AppKit:x86_64+0x33f4e1)
    #22 0x7fff2df36254 in NSSLMMenuEventHandler (AppKit:x86_64+0x33f254)
    #23 0x7fff2f9528d8 in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) (HIToolbox:x86_64+0x88d8)
    #24 0x7fff2f951c15 in SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) (HIToolbox:x86_64+0x7c15)
    #25 0x7fff2f951a9b in SendEventToEventTargetWithOptions (HIToolbox:x86_64+0x7a9b)
    #26 0x7fff2f9ac82a in SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*) (HIToolbox:x86_64+0x6282a)
    #27 0x7fff2f9ac5c8 in PopulateMenu(MenuData*, OpaqueEventTargetRef*, CheckMenuData*, unsigned int, double) (HIToolbox:x86_64+0x625c8)
    #28 0x7fff2f9abce7 in Check1MenuForKeyEvent(MenuData*, CheckMenuData*) (HIToolbox:x86_64+0x61ce7)
    #29 0x7fff2f9ac49c in Check1MenuForKeyEvent(MenuData*, CheckMenuData*) (HIToolbox:x86_64+0x6249c)

SUMMARY: AddressSanitizer: heap-buffer-overflow GAME.CPP:267 in check_place(int, int, int)
Shadow bytes around the buggy address:
  0x1c3800001cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1c3800001d00: fa fa fa fa fa fa fa fa fa fa fa fa[fa]fa fa fa
  0x1c3800001d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3800001d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
2018-11-20 21:53:38.845530+0200 tk3[90928:2348280] =================================================================
2018-11-20 21:53:38.845575+0200 tk3[90928:2348280] ==90928==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61c00000e860 at pc 0x000100059f00 bp 0x7ffeefbfe9c0 sp 0x7ffeefbfe9b8
2018-11-20 21:53:38.845594+0200 tk3[90928:2348280] READ of size 4 at 0x61c00000e860 thread T0
2018-11-20 21:53:38.845619+0200 tk3[90928:2348280]     #0 0x100059eff in check_place(int, int, int) GAME.CPP:267
2018-11-20 21:53:38.845634+0200 tk3[90928:2348280]     #1 0x10005b24d in place_normal_game_crates() GAME.CPP:329
2018-11-20 21:53:38.845642+0200 tk3[90928:2348280]     #2 0x100069f67 in game() GAME.CPP:2316
2018-11-20 21:53:38.845656+0200 tk3[90928:2348280]     #3 0x10006c536 in menu() GAME.CPP:2481
2018-11-20 21:53:38.845669+0200 tk3[90928:2348280]     #4 0x10006d218 in main GAME.CPP:2598
2018-11-20 21:53:38.845682+0200 tk3[90928:2348280]     #5 0x7fff5d755084 in start (libdyld.dylib:x86_64+0x17084)
2018-11-20 21:53:38.845691+0200 tk3[90928:2348280] 
2018-11-20 21:53:38.845699+0200 tk3[90928:2348280] 0x61c00000e860 is located 32 bytes to the left of 1904-byte region [0x61c00000e880,0x61c00000eff0)
2018-11-20 21:53:38.845708+0200 tk3[90928:2348280] allocated by thread T0 here:
2018-11-20 21:53:38.845723+0200 tk3[90928:2348280]     #0 0x1009b4f53 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x56f53)
2018-11-20 21:53:38.845740+0200 tk3[90928:2348280]     #1 0x7fff306ace65 in -[__NSArrayM insertObject:atIndex:] (CoreFoundation:x86_64h+0x2ce65)
2018-11-20 21:53:38.845750+0200 tk3[90928:2348280]     #2 0x7fff306e52d1 in ___CFBundleReadDirectory_block_invoke (CoreFoundation:x86_64h+0x652d1)
2018-11-20 21:53:38.845759+0200 tk3[90928:2348280]     #3 0x7fff306a528e in _CFIterateDirectory (CoreFoundation:x86_64h+0x2528e)
2018-11-20 21:53:38.845824+0200 tk3[90928:2348280]     #4 0x7fff306e50b1 in _CFBundleReadDirectory (CoreFoundation:x86_64h+0x650b1)
2018-11-20 21:53:38.845835+0200 tk3[90928:2348280]     #5 0x7fff306e4b86 in _createQueryTableAtPath (CoreFoundation:x86_64h+0x64b86)
2018-11-20 21:53:38.845850+0200 tk3[90928:2348280]     #6 0x7fff306e4102 in _copyQueryTable (CoreFoundation:x86_64h+0x64102)
2018-11-20 21:53:38.845862+0200 tk3[90928:2348280]     #7 0x7fff306e397e in _copyResourceURLsFromBundle (CoreFoundation:x86_64h+0x6397e)
2018-11-20 21:53:38.845871+0200 tk3[90928:2348280]     #8 0x7fff306e32d8 in _CFBundleCopyFindResources (CoreFoundation:x86_64h+0x632d8)
2018-11-20 21:53:38.845890+0200 tk3[90928:2348280]     #9 0x7fff306e8382 in CFBundleCopyResourceURL (CoreFoundation:x86_64h+0x68382)
2018-11-20 21:53:38.845902+0200 tk3[90928:2348280]     #10 0x7fff306f56f9 in _copyStringFromTable (CoreFoundation:x86_64h+0x756f9)
2018-11-20 21:53:38.845978+0200 tk3[90928:2348280]     #11 0x7fff306f5376 in CFBundleCopyLocalizedStringForLocalization (CoreFoundation:x86_64h+0x75376)
2018-11-20 21:53:38.846008+0200 tk3[90928:2348280]     #12 0x7fff2e558464 in _NSLocalizedServiceBundleString (AppKit:x86_64+0x961464)
2018-11-20 21:53:38.846025+0200 tk3[90928:2348280]     #13 0x7fff2df64d88 in -[_NSServiceEntry localizedTitle] (AppKit:x86_64+0x36dd88)
2018-11-20 21:53:38.846041+0200 tk3[90928:2348280]     #14 0x7fff2df64bba in -[_NSServiceEntry menuItemTitle] (AppKit:x86_64+0x36dbba)
2018-11-20 21:53:38.846055+0200 tk3[90928:2348280]     #15 0x7fff2df644df in __copySortedEntries_block_invoke (AppKit:x86_64+0x36d4df)
2018-11-20 21:53:38.846064+0200 tk3[90928:2348280]     #16 0x7fff5d800ed6 in _qsort (libsystem_c.dylib:x86_64+0x5fed6)
2018-11-20 21:53:38.846074+0200 tk3[90928:2348280]     #17 0x7fff2df642a2 in -[_NSServicesMenuUpdater insertServicesIntoMenu:withKeyEvent:isForDisplay:] (AppKit:x86_64+0x36d2a2)
2018-11-20 21:53:38.846089+0200 tk3[90928:2348280]     #18 0x7fff2df6415f in -[_NSServicesMenuUpdater updateMenu:withEvent:withFlags:] (AppKit:x86_64+0x36d15f)
2018-11-20 21:53:38.846158+0200 tk3[90928:2348280]     #19 0x7fff2df37f1c in -[_NSServicesPrincipalMenuUpdater updateMenu:withEvent:withFlags:] (AppKit:x86_64+0x340f1c)
2018-11-20 21:53:38.846170+0200 tk3[90928:2348280]     #20 0x7fff2de19c57 in -[NSMenu _populateWithEventRef:] (AppKit:x86_64+0x222c57)
2018-11-20 21:53:38.846179+0200 tk3[90928:2348280]     #21 0x7fff2df364e1 in -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] (AppKit:x86_64+0x33f4e1)
2018-11-20 21:53:38.846195+0200 tk3[90928:2348280]     #22 0x7fff2df36254 in NSSLMMenuEventHandler (AppKit:x86_64+0x33f254)
2018-11-20 21:53:38.846204+0200 tk3[90928:2348280]     #23 0x7fff2f9528d8 in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) (HIToolbox:x86_64+0x88d8)
2018-11-20 21:53:38.846218+0200 tk3[90928:2348280]     #24 0x7fff2f951c15 in SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) (HIToolbox:x86_64+0x7c15)
2018-11-20 21:53:38.846279+0200 tk3[90928:2348280]     #25 0x7fff2f951a9b in SendEventToEventTargetWithOptions (HIToolbox:x86_64+0x7a9b)
2018-11-20 21:53:38.846293+0200 tk3[90928:2348280]     #26 0x7fff2f9ac82a in SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*) (HIToolbox:x86_64+0x6282a)
2018-11-20 21:53:38.846310+0200 tk3[90928:2348280]     #27 0x7fff2f9ac5c8 in PopulateMenu(MenuData*, OpaqueEventTargetRef*, CheckMenuData*, unsigned int, double) (HIToolbox:x86_64+0x625c8)
2018-11-20 21:53:38.846325+0200 tk3[90928:2348280]     #28 0x7fff2f9abce7 in Check1MenuForKeyEvent(MenuData*, CheckMenuData*) (HIToolbox:x86_64+0x61ce7)
2018-11-20 21:53:38.846334+0200 tk3[90928:2348280]     #29 0x7fff2f9ac49c in Check1MenuForKeyEvent(MenuData*, CheckMenuData*) (HIToolbox:x86_64+0x6249c)
2018-11-20 21:53:38.846347+0200 tk3[90928:2348280] 
2018-11-20 21:53:38.846355+0200 tk3[90928:2348280] SUMMARY: AddressSanitizer: heap-buffer-overflow GAME.CPP:267 in check_place(int, int, int)
2018-11-20 21:53:38.846419+0200 tk3[90928:2348280] Shadow bytes around the buggy address:
2018-11-20 21:53:38.846435+0200 tk3[90928:2348280]   0x1c3800001cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846445+0200 tk3[90928:2348280]   0x1c3800001cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846454+0200 tk3[90928:2348280]   0x1c3800001cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846462+0200 tk3[90928:2348280]   0x1c3800001ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846480+0200 tk3[90928:2348280]   0x1c3800001cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846489+0200 tk3[90928:2348280] =>0x1c3800001d00: fa fa fa fa fa fa fa fa fa fa fa fa[fa]fa fa fa
2018-11-20 21:53:38.846498+0200 tk3[90928:2348280]   0x1c3800001d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846559+0200 tk3[90928:2348280]   0x1c3800001d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846570+0200 tk3[90928:2348280]   0x1c3800001d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846584+0200 tk3[90928:2348280]   0x1c3800001d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846593+0200 tk3[90928:2348280]   0x1c3800001d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2018-11-20 21:53:38.846607+0200 tk3[90928:2348280] Shadow byte legend (one shadow byte represents 8 application bytes):
2018-11-20 21:53:38.846616+0200 tk3[90928:2348280]   Addressable:           00
2018-11-20 21:53:38.846625+0200 tk3[90928:2348280]   Partially addressable: 01 02 03 04 05 06 07
2018-11-20 21:53:38.846638+0200 tk3[90928:2348280]   Heap left redzone:       fa
2018-11-20 21:53:38.846647+0200 tk3[90928:2348280]   Freed heap region:       fd
2018-11-20 21:53:38.846656+0200 tk3[90928:2348280]   Stack left redzone:      f1
2018-11-20 21:53:38.846664+0200 tk3[90928:2348280]   Stack mid redzone:       f2
2018-11-20 21:53:38.846691+0200 tk3[90928:2348280]   Stack right redzone:     f3
2018-11-20 21:53:38.846699+0200 tk3[90928:2348280]   Stack after return:      f5
2018-11-20 21:53:38.846710+0200 tk3[90928:2348280]   Stack use after scope:   f8
2018-11-20 21:53:38.846719+0200 tk3[90928:2348280]   Global redzone:          f9
2018-11-20 21:53:38.846727+0200 tk3[90928:2348280]   Global init order:       f6
2018-11-20 21:53:38.846741+0200 tk3[90928:2348280]   Poisoned by user:        f7
2018-11-20 21:53:38.846749+0200 tk3[90928:2348280]   Container overflow:      fc
2018-11-20 21:53:38.846757+0200 tk3[90928:2348280]   Array cookie:            ac
2018-11-20 21:53:38.846765+0200 tk3[90928:2348280]   Intra object redzone:    bb
2018-11-20 21:53:38.846773+0200 tk3[90928:2348280]   ASan internal:           fe
2018-11-20 21:53:38.846781+0200 tk3[90928:2348280]   Left alloca redzone:     ca
2018-11-20 21:53:38.846789+0200 tk3[90928:2348280]   Right alloca redzone:    cb
2018-11-20 21:53:38.846835+0200 tk3[90928:2348280] 
==90928==ABORTING

if ( level[( ( y + size ) / 20 ) *level_x_size + ( x / 20 ) ].type!= FLOOR ) ret = 1;

Some keyboards don't have right ctrl

The default keybinding for player 1 shoot is right ctrl, which doesn't exist in all keyboards, most notably small Apple keyboards including the built-in keyboard for all Macbooks.

I'm not sure if we should try to fix this somehow, or just document in the README that you have to change keybindings before playing if your keyboard doesn't have a right ctrl.

Build macOS .app

Let's figure out how to build a self-contained macOS .app!

The end goal is a single UltimateTapanKaikki.app deliverable that doesn't need e.g. sdl, etc. from brew.

Network gaming support in web port

Implement network gaming support in web port. SDL Net uses TCP sockets which ain't available in browsers. Use WebRTC or similar approach to allow p2p connections.

Segfault in Enemy::move()

Via @akheron

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055cd35509ca0 in Enemy::move(int, int) ()
[Current thread is 1 (Thread 0x7fbbf1d93740 (LWP 11856))]
(gdb) bt
#0  0x000055cd35509ca0 in Enemy::move(int, int) ()
#1  0x000055cd3551d262 in move_enemies() ()
#2  0x000055cd35520399 in game_shit() ()
#3  0x000055cd35525515 in game() ()
#4  0x000055cd35526080 in menu() ()
#5  0x000055cd35502ef8 in main ()

Player properties are mixed in co-op

Bug exists in TK321.

In single player game, player properties are as follows

  • Player [0]
    • Player 1 keys
    • Player 1 name
    • Red color

In co-op game, players are as follows

  • Player [0]
    • Player 2 keys
    • Player 1 name
    • Red color
  • Player [1]
    • Player 1 keys
    • Player 2 name
    • Green color

Shop and killing list after a level shows names wrong way around compared to what is set in Options.

It makes sense to have the keys inverted because normally primary player is playing with arrows on right and secondary player with WASD on left. It then matches the splitter screen. It's probably best to invert names. Also colors could be swapped so that player on arrow keys has red character when playing single player or co-op.

Game is rendered 320x200 instead of 320x240

Original game changes can change resolution from 320x200 to 320x240 during actual game play if supported. Currently this port is rendering everything at 320x200.

kuva
DOSBox rendering 320x240 on top.

Name changing input accepts non-visible characters

If pressing buttons like Ctrl, Alt, Shift etc. during player name change (Options - Player Options - Change Pl[1,2] Keys), invisible characters are added. Characters should be filtered to only contain visible characters (+ maybe space).

Simultaneously joining network clients can break the game

Issue is in original TK code, not in port.

If client joins to game but waits in "game info" (see below) it doesn't yet update "enabled" status of a new player on server side. Player only gets enabled when clients starts to send alive-messages which only happens during actual gameplay.

joining_game

If another player joins during one being in screen above, same player index is assigned by the server to new client. This leads to various panics and broken game.

Best fix might be to start sending alive-messages already in joining screen - but that still needs to be validated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.