• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Wolfenstein3D clone in Go

WolfenGo

This is a clone of Wolfenstein3D written in Go, based on Wolfenstein3DClone and licensed under GNU/GPLv2.

Pull requests are welcome.

Plan

  • initial conversion
  • fix remaining bugs
  • add audio effects

Build Dependencies

WolfenGo uses glfw C bindings, which in turn need some Linux userland headers to be installed. Example of dependencies installation on a Debian-based system:

apt-get install libgl1-mesa-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev

Building

make

Then you can run:

bin/wolfengo

There are some constants in main.go that can be toggled to enable further debugging/experimentation.

Controls

Use W,A,S,D to move the player around and E to open doors; by clicking in the game window you will enable free mouse look, that can be disabled with ESC.

Pressing Q causes the game to quit, as it does closing the game window itself.

History

Aside from some dead/unused code that I have dropped and bugs inadvertently introduced in the porting process, this is my (gdm85) literal conversion of the Java Wolfenstein3D clone by BennyQBD; feel free to spin up the Java original version to check how identical and indistinguishable the two are.

Notable differences:

  • map format has been changed, see relative section
  • enabled VSync
  • although extra shaders are included, they are not used by default in any way

Although mathgl could have been used for the 3D math/raycast operations, I preferred to keep the simpler original structures.

Some lessons learnt during the porting process:

  • after 10 years I last experimented with OpenGL debugging, it's still hard. apitrace helped a lot
  • Go's int is 64bit on 64bit platforms, a visual inspection doesn't tip off this easily and one could skip the fact that OpenGL needs to know the proper size (4 or 8 bytes)
  • a minus sign here and there can screw up a lot of projections/translations

Development started on 4 January and completed with the first release on Github on 24th January with squashed/cleaned up commits. See also my blog post about WolfenGo initial release for extras about the development/porting process.

Map format

The map format has been changed as well to be easier to edit via text editors (although the new format it's far from being final).

Some extensions have been added for other items (FPS lore quiz: where have you seen this map format already?)

The first lines of the map define walls:

wall1   {1.00,0.75,0.75,1.00}
wall2   {0.25,0.00,0.00,0.25}

The values in curly braces are texture coordinates from the tileset WolfCollection.png. After that follows the lengthmap definition to indicate map size:

lengthmap       032

The value 32 means that this is a 32x32 map.

Subsequently there are the MAP, PLANES and SPECIALS sections, each of them describing with n = 32 lines of n = 32 characters either a wall value, a floor/ceiling value or a special item. Wall characters start at 1 and (unfortunately) right now can as well go above 9.

The special items that are currently supported are:

  • m to indicate a small medkit
  • e to indicate an enemy
  • d to indicate a door
  • A to indicate player start position
  • X to indicate level exit

Thanks

Obviously thanks to BennyQBD for the initial clone Java sources and also to https://github.com/go-gl/gl which - although not easy to master - is indeed in a good status for usage in Go OpenGL projects.

More Repositories

1

docker-fw

docker-fw is a complementary tool for Docker to manage iptables-based custom firewall rules between/towards containers, persistence and two-ways links.
Go
71
star
2

grpc-go-multiplex

gRPC/HTTP multiplexing example (AWS ELB etc)
Go
42
star
3

coshell

Dependency-free replacement for GNU parallel, perfect fit for usage in an initramfs.
Go
42
star
4

go-libdeluge

A native Deluge RPC client library
Go
39
star
5

go-libiptc

libiptc bindings for Go language. Object-oriented design, supports IPv6 and same wait locking mechanism as iptables/ip6tables.
Go
30
star
6

go-websockproxy

Websockets server for ethmac networking support to jor1k
Go
16
star
7

go-rencode

Go implementation of Python's rencode: fast (basic) object serialization similar to bencode
Go
12
star
8

go-genums

Utility to generate type-checked enums, friendly for usage with go:generate.
Go
11
star
9

iftop

Mirror of https://code.blinkace.com/pdw/iftop plus patches for the RESTful API
C
11
star
10

lc

List files in categories (and columns) - from Coherent UNIX
C
9
star
11

tenku

scripts for configuration management, continuous integration, containers (docker!)
Shell
6
star
12

ubuntu16-no-systemd

Home of the no-systemd team and PPA: https://launchpad.net/~no-systemd/+archive/ubuntu/ppa
Shell
6
star
13

distrilock

NFS-based Go locking service - distributed locking for pennies
Go
5
star
14

l2tp-ipsec-vpn

L2TP over IPsec VPN Manager
C++
3
star
15

docker-cli-tools

Set of command-line tools handy for continuous integration and development with Docker
Go
1
star
16

win98-logout

A Windows 98-like logout dialog for XFCE
Go
1
star
17

sakura

Fork of Sakura from http://bazaar.launchpad.net/~dabisu/sakura/sakura/files (bzr -> git)
C
1
star