heXon [LucKey Productions]

heXon

FOSS TWIN-STICK-SHOOTER


Binaries:
heXon on itch.io

Source:
heXon on GitHub

Pickups:
Golden apple / Provides 23 points. Collect 5 apples in a row to get weapon upgrades. Picking up a Heart breaks the count.
Heart / Heals half of your max life. Collect 5 hearts in a row to get a shield upgrade. Picking up an Apple breaks the count.

MultiX / Increases your score multiplier.
ChaoBall / Turns enemies into useful ChaoMines and disrupts Seekers

Enemies:
Razors / Mostly harmless in small numbers. Don’t fly into them though. 5 points on destruction.
Spires / These sturdy towers launch Seekers; player seeking foo fighters that should be evaded. 10 points when obliterated.

Noteworthy:
Explosions repel most objects.
Reaching the end of the net will send most objects to the opposite side.

Controls:
heXon is best played using a dual stick controller and was developed and tested with Sony PS3 SIXAXIS controllers on Xubuntu and Linux Mint.

Keyboard controls are as such:
Movement / WASD
Firing / IJKL or the numpad
Pause / P


Tools:
Urho3D, QtCreator, Blender, Inkscape, GIMP, SuperCollider, Audacity and more (All FOSS)

Soundtrack:
Alien Chaos - Disorder
from Discovering the Code

Awesome work ! Looks really cool I will try it tonight.

It did just occur to me I made some engine modifications that are yet unpushed. Will try to fix that.

Yeah I am having some problems building it. Is there anything special I need to do in order to build it ?

Are you using QtCreator for the build process?
Did you SymLink/Copy the Data, CoreData and Resources folders?

Are you getting any undefined method errors?

The errors are not related to the resources. I think you have added modifications to the engine.
These are the errors:

mastercontrol.h:119:59: No member named 'Length' in 'Urho3D::Vector<double>' mastercontrol.h:119:70: Use of undeclared identifier 'Cycle' mastercontrol.h:120:57: No member named 'Length' in 'Urho3D::Vector<double>' mastercontrol.h:120:68: Use of undeclared identifier 'Cycle' arenaedge.cpp:43:16: No matching member function for call to 'SetScale' arenaedge.cpp:44:34: Too many arguments to function call, expected single argument 'position', have 3 arguments arenaedge.cpp:79:9: No member named 'Distance' in 'Urho3D::Vector3'; arenaedge.cpp:79:27: No viable conversion from 'Urho3D::Vector3' to 'const btVector3'

Correct.

Is fixed by adding the following to VectorBase.h:

Is fixed by adding the following to MathDefs.h:

/// Return the cycled value of a float inline float Cycle(float value, float min, float max) { float cycled = value; float range = max - min; if (cycled < min) { cycled += range * abs(ceil((min - cycled) / range)); } else if (cycled > max) { cycled -= range * abs(ceil((cycled - max) / range)); } return cycled; } /// Return the cycled value of a double inline double Cycle(double value, double min, double max) { double cycled = value; double range = max - min; if (cycled < min) { cycled += range * abs(ceil((min - cycled) / range)); } else if (cycled > max) { cycled -= range * abs(ceil((cycled - max) / range)); } return cycled; } /// Return the cycled value of an int inline int Cycle(int value, int min, int max) { int cycled = value; int range = max - min; if (cycled < min) { cycled += range * abs(ceil((min - cycled) / range)); } else if (cycled > max) { cycled -= range * abs(ceil((cycled - max) / range)); } return cycled; }

arenaedge.cpp:79:9: No member named 'Distance' in 'Urho3D::Vector3'; arenaedge.cpp:79:27: No viable conversion from 'Urho3D::Vector3' to 'const btVector3'
Should both be fixed by adding the following to Vector3.h:

/// Return length of difference vector static float Distance(const Vector3& lhs, const Vector3& rhs) { return (lhs-rhs).Length(); }

arenaedge.cpp:43:16: No matching member function for call to 'SetScale' arenaedge.cpp:44:34: Too many arguments to function call, expected single argument 'position', have 3 arguments
Should be fixed with latest heXon commit.

I know this is not the way to do things. I’m still finding out what is.

There are still a lot of issues.
There are a lot of 3 floats where they should be Vector3 . Some of the function calls are ambigious as there are mixes of floats and doubles.
There is a missing define for M_TAU . After fixing a lot of these I tried to compile but I started getting. A lot of incomplete return types to ‘Urho3D::URHO3D_API’ .
This is the complet error list after fixing the small things: codepad.org/Pusn3B6Y
At the end I gave up, as I am not sure what is causing the issue.

[quote=“sabotage3d”]There are still a lot of issues.
There are a lot of 3 floats where they should be Vector3 . Some of the function calls are ambigious as there are mixes of floats and doubles.
There is a missing define for M_TAU . After fixing a lot of these I tried to compile but I started getting. A lot of incomplete return types to ‘Urho3D::URHO3D_API’ .
This is the complet error list after fixing the small things: codepad.org/Pusn3B6Y
At the end I gave up, as I am not sure what is causing the issue.[/quote]

That’s usually caused by a missing #include <Urho3D/Urho3D.h>, but that seems to be included in the headers already. There may be some non-standard stuff going on, and at the very least I’d recommend throwing in some header guards instead of solely relying on #pragma once.

Most of this should be fixed a few commits ago.

Stopped using that as well with the latest commit.

Thanks for the effort.

Fixed the header guards.

In you latest commits these are still errors which are easy to fix. After fixing those there are still the previous issue with the incomplete type. It is super weird because If I call Rand() in a clean project everything works fine.
codepad.org/0kvVf6df

arenaedge.cpp:44:34: Too many arguments to function call, expected single argument 'position', have 3 arguments enemy.cpp:49:84: Call to 'Max' is ambiguous explosion.cpp:37:18: Non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list explosion.cpp:82:25: Call to 'Max' is ambiguous explosion.cpp:83:27: Call to 'Max' is ambiguous flash.cpp:51:27: Call to 'Max' is ambiguous player.cpp:108:39: Too many arguments to function call, expected single argument 'position', have 3 arguments player.cpp:109:21: No matching member function for call to 'SetScale' player.cpp:115:39: Too many arguments to function call, expected single argument 'position', have 3 arguments player.cpp:116:21: No matching member function for call to 'SetScale' player.cpp:122:44: Too many arguments to function call, expected single argument 'position', have 3 arguments player.cpp:131:59: Too many arguments to function call, expected single argument 'position', have 3 arguments player.cpp:142:56: Too many arguments to function call, expected single argument 'position', have 3 arguments player.cpp:181:52: Call to member function 'Sine' is ambiguous player.cpp:183:52: Call to member function 'Sine' is ambiguous player.cpp:331:37: Call to 'Clamp' is ambiguous

The problem was with the multiple includes in your source files to the Urho3d headers. I fixed it in a working states there is only one thing I can’t figure out
There is a problem here:

Which gives this error:

I made temporary fix which is wrong but atleast it compiles.

These are my changes: github.com/sabotage3d/heXon/com … feb45f7197

[quote=“sabotage3d”]The problem was with the multiple includes in your source files to the Urho3d headers. I fixed it in a working states there is only one thing I can’t figure out
There is a problem here:

Which gives this error:

I made temporary fix which is wrong but atleast it compiles.

These are my changes: github.com/sabotage3d/heXon/com … feb45f7197[/quote]

Try adding following in IntVector2.h
unsigned ToHash()
{
return ToString().ToHash();
}

I think it will work. :smiley:

Thanks it works but it needs const.

unsigned ToHash() const { return ToString().ToHash(); }

[quote=“att”]Try adding following in IntVector2.h
unsigned ToHash()
{
return ToString().ToHash();
}[/quote]

I only have a Vector2.h (no IntVector2.h) and within the class definition of Intvector2 it has this line:

/// Return hash value for HashSet & HashMap. unsigned ToHash() const { return (MakeHash(x_) & 0xffff) | (MakeHash(y_) << 16); }
…which I somehow expect to do a better job.

@Sabotage3D: The tileMap_ HashMap uses IntVector2 keys for checking neighbouring tiletypes when semi-auto mapping. This doesn’t happen in heXon yet, but it does in another LucKey Production called Masters of Oneiron from where I reused the code. At the moment heXon only uses the values of the HashMap to pick a random tile as a spawn point. Using only one of the iterators instead of the hashed IntVector2 as key will, I expect, make all enemies and pickups (re)spawn below the left edge of the arena.

The code has been changed so that it should compile with default Urho3D.

I think your chages would be a nice addition to the engine. Maybe you can try and push some of them to the main branch.

The Length() method turned out to be useless. It was the more aptly named Size() I was looking for. But indeed I intend to submit the other changes as pull requests to the Engine. I’m still learning git as well, requesting pulls requires steps I didn’t take before.
Did you get heXon to compile btw? There is no in-game settings screen as of yet; the resolution is set in mastercontrol.cpp.

I had compiled it for mobile, but it always crash sometimes.

I built this game in Windows and played it a bit.

I did have a crash issue whenever I fired a bullet, but it was an easy fix. Just add a distance check in:

bool MasterControl::PhysicsRayCast(PODVector<PhysicsRaycastResult> &hitResults, Ray ray, float distance, unsigned collisionMask = M_MAX_UNSIGNED)
{
    if ( distance > 1e-9f )
    {
        physicsWorld_->Raycast(hitResults, ray, distance, collisionMask);
    }

    return ( hitResults.Size() > 0 );
}

fix the issue and I was able to play it.

I really like the feel of this game. Good luck finishing it.

Edit: There are a couple of optimization issues that you might want to address: 1) there’s often a frame rate lag whenever, I guess, objects spawn in the world. If all objects were pre-cached, this problem would go away. 2) the ray cast, or any collision for that matter, could be limited to run at 32 msec interval and it’ll still be okay. Urho3D’s tick is 10msec interval so, it might bog your game down a bit.

Edit2: Just stepped through bt ::stepSimulation() and the timeStep is actually 0.039 secs, so it looks like Urho3D processes collision at a good interval.