GithubHelp home page GithubHelp logo

arthurmco / familyline-testbed Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 3.32 MB

nice and fun RTS game about the adventures of family in the ancient era. Homebrew engine. Just starting. Shitty graphics are expected

License: MIT License

CMake 3.63% C++ 90.57% NSIS 0.26% GLSL 0.46% Python 2.44% C 0.59% Scheme 1.77% Emacs Lisp 0.21% CSS 0.03% MAXScript 0.05%
cpp gamedev rts-game

familyline-testbed's People

Contributors

arthurmco avatar dependabot[bot] avatar donovang360 avatar remyabel2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

familyline-testbed's Issues

NVIDIA driver logs complain about texture not having a defined base level

The logs say this:

[       0.6116] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6120] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6120] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 1 does not have a defined base level and cannot be used for texture mapping.
[       0.6364] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6368] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6368] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 1 does not have a defined base level and cannot be used for texture mapping.
[       0.6612] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6617] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6617] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 1 does not have a defined base level and cannot be used for texture mapping.
[       0.6859] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6863] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.6863] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 1 does not have a defined base level and cannot be used for texture mapping.
[       0.7103] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.7107] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.7108] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 1 does not have a defined base level and cannot be used for texture mapping.
[       0.7348] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.
[       0.7352] [debug] gl-debug-opengl-api: [#131204]  low prio:  other: Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping.

The objects render normally, though.

The warning is a low-priority one, but it appears a lot, so I want to investigate.

The reason is probably that textures are not mipmapped in this game, but I am not 100% certain

This can help: https://www.khronos.org/opengl/wiki/Texture#Mip_maps

Port to Mac OS X

Let's present this game to the wonderful, colorful kingdom of Tim Cook!

It might build, but I need help to see if it builds, either by someone gently doing this for me, or someone I know lending me a Macbook.

Port to Vulkan

I want to port this engine, currently OpenGL, to Vulkan, because it is modern and everybody it's using.

But before, I wanna make the engine worth of be ported

  • Use more than one thread, stably.
    Yes, we have some areas that can use multithreading. One example is the terrain and scene object rendering.
  • Use some advanced graphical effect
    Use something like SSAO or water reflection effects. The graphical subsystem might be adapted for it, and can mature it enough to make it worth of a Vulkan port

Rename "game object" to "game entity"

Rename any place that says "game object" (including the GameObject class) to "game entity"

I think this might be a better name, and other engines also call them entities, not objects.

Add support for collada models

Collada models, with the .dae extension, are used in a lot of games and game engines.

It might be a good idea to support it.

Check the engine timings

I have an impression that the logic part of the game runs faster in faster PCs

It should not be like that.
The logic part should run at constant speed.
The graphical part of the game should run faster in faster PCs

Check this, and fix it if it's true.

Absurd memory leaking

The game is leaking memory. A lot.

Probably the fault is on the pathfinder, but only probably.

The images are more or less after 10 and 25 minutes of runtime, respectively

image

image

As you can see, its memory consumption is bigger than Chrome, a browser who is bullied for consuming a lot of memory.

This happens on Windows, but probably happens on other platforms too.

Please run this on Valgrind and check

Rewrite the input system

The current input system does not sepparate inputs from actions. This can be bad if the user needs to switch the default keys to other keys of its liking

For example, separating the input of the letter 'Q` to the action of "Building a house"

Also, rewrite the player system to respond to the actions instead

Rewrite the GUI subsystem

The GUI subsystem has some problems

  • it's hard to understand
  • it's not easy to test: the logic code is so coupled with the rendering code that testing is hard
  • it's surprisingly slow.

A complete rework of the gui subsystem is needed to fix that.

Random crashes on Windows

On Windows, the game crashes and freezes frequently, unlike on Linux, where this almost never happen.

Check what might be the cause

Write the game history

Start writing the game history.
I have a summary of the game history, but I'd like to write it, completely and nicely, somewhere, here.

Probably I'm going to use the wiki for that

But first...

  • Stabilize the game engine
    Make it stable, ie without crashing enough for people to play
  • Support a popular model format
    A popular model format, like fbx or collada (see #3), would encourage people to develop models based on these histories.
  • Ease the development of buildings and units

Steam

Someday, I wanna put this game on Steam.

This might require using some nonfree components, like the steamworks sdk, but we can make it an addon, and keep the rest of the game free.

Rewrite the logic engine

Redo the logic engine.

Go for a more message-oriented approach: instead of snooping into the object manager's object list, the object manager will send a message to the appropriate listeners whenever the object has been created or destroyed.

We might also define other operations alongside creation or deletion.

Work is being done on the dev/logic-engine-rewrite branch.

Update the documentation

We need to update the information inside the files in docs folder, because they might be old and wrong.

Some things:

  • Change the format to ReSTructuredText, because I want to use sphinx in the future. Besides, rst look nicer than md for things like tables, etc
  • Update the documentation with the latest info, and keep it that way.

Define the units and buildings in Scheme

I want to define units and buildings outside the game binary, so the development of them becomes easier.

The language Lua seems a good choice, because it is used in a large number of projects successfully

But first

  • Review the game object cloning.
    I think the game object code needs a review, specially the cloning and parameter storing part.
  • Review the object factory code for any problems
  • Wait for the object functions/classes stabilization
    I'd rather wait a little bit more than start rewriting the lua functions every week.

`GFXDebugDrawer` is leaking memory

This debug drawer leaks more memory than Biroliro burns trees

On Windows, it is leaking 400 kb/sec more or less.

If the debug drawer is replaced by the dummy debug drawer (added on 467414c), those leaks stop occurring.

Support animation on meshes

Do some research and find a nice way to animate our meshes.

Decide between mesh deformation or bone deformation, or support both (with different shaders, maybe? (Bone deformations are almost always processed on the GPU)

Any help in this subject is welcome!

Improve the animation subsystem

Currently, support for animated meshes is poor.

We need to have it, so the game looks more dynamic, with moving constructions, like boats that moves their sails, or mills that moves their pads.

It needs to support mesh deformation, for simple animations, and skeletal animation, for more complex ones. It might need to support static ones, at least for now

Segfault when running on Nvidia Optimus hardware on Linux

The game crashes when running on Optimus hardware on Linux.

Seems a driver thing, because this does not happen on Windows

The output is:

[manjaro@manjaro-gnome build]$ sudo primusrun ./familyline 
[       0.0000]  Familyline 0.1.97
[       0.0000]  built on Feb 13 2020 by manjaro
[       0.0001]  git commit is 1885a7b
[       0.0001]  Actual date is 2020-02-13 04:56:52
[       0.0001]  Default model directory is ./models/
[       0.0002]  Default texture directory is ./textures/
[       0.0002]  Default material directory is ./materials/
[       0.7978] main: driver found: x11 (default)
[       0.7979] main: driver found: wayland 
[       0.7979] main: driver found: KMSDRM 
[       0.7979] main: driver found: dummy 
[       0.7979] input-listener: Created input listener 'default'
[       0.7979] input-manager: Adding listener order 0.000 for event mast 0xffffffff
[       0.8760] init: KHR_debug supported
[       0.8761] fb: creating framebuffer f3D: handle=0x1, size=640 x 480
[       0.8762] gl-debug-opengl-api: [#131169] low prio:  other: Framebuffer detailed info: The driver allocated storage for renderbuffer 1.
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                              ��%
[       0.8770] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8770] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8771] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <texture> is not the name of an existing texture.
[       0.8771] fb: 	completed: texhandle=0x1, rbohandle=0x1
[       0.8771] fb: creating framebuffer fGUI: handle=0x2, size=640 x 480
[       0.8771] gl-debug-opengl-api: [#131169] low prio:  other: Framebuffer detailed info: The driver allocated storage for renderbuffer 2.
[       0.8776] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8776] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                              ��%
[       0.8777] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8777] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8777] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8777] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <texture> is not the name of an existing texture.
[       0.8777] fb: 	completed: texhandle=0x2, rbohandle=0x2
[       0.8777] input-listener: Created input listener 'gui-listener'
[       0.8777] input-manager: Adding listener order 0.800 for event mast 0x7
[       0.8822] gl-debug-opengl-api: [#131185] other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[       0.8822] gl-debug-opengl-api: [#131185] other: Buffer detailed info: Buffer object 4 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[       0.8822] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
640.00 480.00[       0.8822] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                                           ��%
[       0.8823] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8823] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8823] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8823] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. <maxLength> must not be negative.��%
[       0.8823] texture: Discovered texture max size: -1x-1
[       0.8823] texture: (FATAL) Invalid texture max size. Something is wrong
[       0.8823] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. <maxLength> must not be negative.��%
[       0.8823] texture: Discovered texture max size: -1x-1
[       0.8823] texture: (FATAL) Invalid texture max size. Something is wrong
[       0.8823] texture: maximum tex size: 0 x 0
[       1.2121] gui-image-control: opening image './icons//familyline-logo.png'
[       1.2121] gui-image-control: image has size 794.00 x 937.00
[       1.2236] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <buffer> enum is invalid; expected GL_DEPTH_STENCIL.�
[       1.2236] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. Object handle does not refer to an object generated by OpenGL.
Segmentation fault

lspci output is

01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev ff) (prog-if ff)
	!!! Unknown header type 7f
	Kernel modules: nouveau, nvidia_drm, nvidia

Graphical renderer quality improvements: First Stage

First part of the rendering improvements I want to add, just the sufficient for the future assets to look acceptable.

  • Specular lights
  • Shadows from the directional light
  • Skybox (helps with the light & for future light reflection)
  • Handle materials that emit light
  • Anisotropic filtering (that terrain texture is awful)

With those things, we might be able to receive nicer assets, like meshes and textures, and they will look, at least, good.

Compilation is broken on MSVC 2019

The compiler gives an error about something in the <optional> header, and the error happens while parsing player_manager.cpp

GCC and Clang compiles this code.

Reversing the code do an early version (that did not have the optional header there) fails too. I suspect it is a bug in MSVC, but I am not sure.

This happens on the devel branch, and curiosly on the master too, when things ran perfectly fine

The compiler log:

...deleted...
[build]   Generating Code...
[build]   Compiling...
[build]   player.cpp
[build]   replay_player.cpp
[build]   player_manager.cpp
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\optional(35,35): error C2131: expression did not evaluate to a constant [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\optional(35,35): message : failure was caused by call of undefined function or one not declared 'constexpr' [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\optional(35,35): message : see usage of 'std::nullopt_t::nullopt_t' [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\set(420,51): warning C4244: 'argument': conversion from 'const uint64_t' to 'int', possible loss of data [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\set(550,46): warning C4244: 'argument': conversion from 'const double' to 'float', possible loss of data [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\set(560,65): warning C4244: 'argument': conversion from 'const double' to 'float', possible loss of data [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\set(418,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build]   terrain.cpp
[build]   terrain_file.cpp
[build] D:\Arquivos\Documentos\projects\familyline\familyline\src\common\logic\terrain_file.cpp(220,17): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [D:\Arquivos\Documentos\projects\familyline\familyline\build\src\common\familyline-common.vcxproj]
[build]   Tent.cpp
[build]   WatchTower.c
...deleted...

The beginning (where you will find the version)

[build]   result='-1'
[build] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
[build] -- Found ZLIB: optimized;D:/vcpkg/installed/x86-windows/lib/zlib.lib;debug;D:/vcpkg/installed/x86-windows/debug/lib/zlibd.lib (found suitable version "1.2.11", minimum required is "1") 
[build] No support for windows + address sanitizer yet
[build] No support for windows + address sanitizer yet
[build] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
[build] -- Configuring done
[build] -- Generating done
[build] -- Build files have been written to: <...>/familyline/familyline/build/googletest-download
[build] Microsoft(R) Build Engine versão 16.9.0+5e4b48a27 para .NET Framework 
[build] Copyright (C) Microsoft Corporation. Todos os direitos reservados.
[build] 
[build] 

Rename the object state subevents

Some state change subevents are very similar to object events.

Rename them to be clearer about their intents.

For example, ObjectState::Created can be renamed to ObjectState::Ready, because it means that the object is ready (building has finished being built, unit has finished being trained.)

Also ObjectState::Creating can be removed as well.

Rewrite the GUI code

  • Make the GUI code better structured: As of now, it is highly hierarchied, and this is not good. Make something component instead of inheritance-based.
  • Make it prettier: Text is not centered or aligned properly, buttons are ugly,,, The GUI needs to be prettier for a videogame, after all, this is a game, not an 1990's X11 application.
  • Customizable: In the future, allow the developer and some future modder to define the control appearance in SVG.

We will continue to use Cairo to render the control, though.

Pathfinder hangs inside a loop

Pathfinder seems to hang randomly on certain ocasions, inside a very time consuming loop inside the PathFinder.cpp file, starting at line 183. Here is the loop

This causes the game to freeze

It do not seem to be related with position, object, terrain height of the origin or destiny

It also seem to be more common in Windows, but also happens in Linux as well, though more rarely.

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.