Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Vapourware Codexian Game Development Thread

zwanzig_zwoelf

Guest
Another early shot.
NXIscVC.jpg
 
Joined
Sep 18, 2013
Messages
1,258
Testing out making the "scanner" actually scan something, now it produces a crude 3-dimensional copy of the environment. Could be a nice gameplay element where you send in drones to scan for enemies etc. Lost of stuff needs fixing to make it look better, but at least the idea works and did not take to long to implement. But to make it look better I think a grid is more appropriate than a radial spread as it is now.



here's my fantasy top-down killer game

http://absum.se/KSWB.zip

AI is fucked up

but at least you can shoot

HOW TO PLAY:
WASD to move
hold mouse button, release to fire arrow

Only 22 bytes and empty when I try to download this, so either I just got a nasty virus by clicking on unknown stuff on the interwebz or something went wrong in your upload :cool:


There was this recent game where you remote-control a drone in an office environment that goes around hacking computers, doors and security systems and must occasionally recharge at power stations inside the building with a short range radar which "scans" and shows the environment in a short lived fashion using basic geometry. I can't recall the title nor find it now but you might like to look into that game.
 

Abelian

Somebody's Alt
Joined
Nov 17, 2013
Messages
2,289
Did you use a greedy best-first search algorithm? That would explain why the function first attempted to go diagonally before realizing the need for backtracking. Even so, the heuristic's performance could justify a small issue like this. Also, do diagonal moves cost as much as those in the cardinal directions or sqrt(2) times as much?
 

potatojohn

Arcane
Joined
Jan 2, 2012
Messages
2,646
It's A*, or it's supposed to be anyway. Diagonal movements cost sqrt(2)

The heuristic is

Code:
inline float Map::heuristic(size_t n1, size_t n2) {
    int16_t d1 = abs(tiles[n1].pos.x - tiles[n2].pos.x);
    int16_t d2 = abs(tiles[n1].pos.y - tiles[n2].pos.y);
    constexpr float D = 1;
    constexpr float D2 = sqrt(2.0) * D;
    
    return D * (d1 + d2) + (D2 - 2 * D) * min(d1, d2);
}

Actually, here's the full code:

https://gist.github.com/dvolk/da3bd15c7f0c6a713179
 

28.8bps Modem

Prophet
Joined
Jan 15, 2014
Messages
302
Location
The Internet, Circa 1993

The core of the problem is here:

Code:
            if(cost_so_far.count(next) == 0 || new_cost < cost_so_far[next]) {
                cost_so_far[next] = new_cost;
                tiles[next].visited = true;
                float priority = new_cost + heuristic(next, goal);
                frontier.put(next, priority);
                came_from.emplace(next, current);
                // draw();
                // sleep(1);
            }

where you're assuming your priority queue has the same uniqueness guarantee that you're abusing in your unordered_maps. It doesn't. What's happening is the same node is being added to the prio queue several times with different priorities and being opened again and again, thoroughly confusing matters. The result would be more amusing if you made a map that needed considerably more backtracking to find a path.

At root it seems like you're scared of defining proper data structures for your map, and using primitives far too often. I recently implemented jump point search, which is A* with some specific optimisations based on known facts about the map, here's what my data structures look like:

TPathNode, the struct for a single tile:

Code:
struct TPathNode
	{
	TBool iOpened;
	TBool iClosed;
	TInt iVertexLength;
	TInt8 iDirection;

	TFloat iG;
	TFloat iF;
	};

The prio queue of path nodes:

Code:
std::priority_queue<TPathNode*, std::vector<TPathNode*>, TPathNodeComparitor> iNodeQueue;

Where my custom comparitor is defined as:

Code:
class TPathNodeComparitor
	{
public:
	TBool operator() (const TPathNode* lhs, const TPathNode* rhs) const;
	};

And implemented:

Code:
TBool TPathNodeComparitor::operator() (const TPathNode* lhs, const TPathNode* rhs) const
	{
	return lhs->iF > rhs->iF;
	}

And the A* core of the algorithm goes:

Code:
				jumppoint_identified:
					/* if we have a backtrack set, that's the jump point otherwise it's the current node */
					if (backtrack)
						jumpNode = backtrack;

					if (!jumpNode->iClosed)
						{
						TFloat tentativeG = current->iG + Heuristic(current, jumpNode);
						if (!jumpNode->iOpened || tentativeG < jumpNode->iG)
							{
							jumpNode->iDirection = direction;
							jumpNode->iVertexLength = Distance(current, jumpNode);
							jumpNode->iG = tentativeG;
							jumpNode->iF = tentativeG + Heuristic(jumpNode, goal);
							}

						if (!jumpNode->iOpened)
							{
							iNodeQueue.push(jumpNode);
							jumpNode->iOpened = true;
							}
						}
					break;
 

Duckard

Augur
Joined
Aug 14, 2010
Messages
354
Action platformer where you use your guns' recoil to maneuver mid-air.

U0r3P4p.gif


Been working on it part-time with a friend. We're going to release soon. For free probably.
 

Duckard

Augur
Joined
Aug 14, 2010
Messages
354
cepheiden

I don't mind any of those if, as you say, they are all adjusted accordingly to keep the balance. Some of them are more simulationist than others, and I do tend to lean towards that side in terms of game mechanics I enjoy or think are cool, but there's nothing inherently bad about abstracting parts of reality. Honestly abstraction is kind of necessary or you end up with an unfinished mess that tries to do too much, or a monster that no one can understand. The other thing is I like the idea of stamina management, so I'd probably roll the non-damage-threshold part of #4 into a stamina system that governs all kinds of actions and not just defense. It's probably also easier to explain to the player, and overall it's better to have a few large systems that govern a lot of things than many small systems that each govern a few things. Interconnectedness is good.


In other news, my game is released (for free). Play it and give me some feedback! TW: Unity (I know people around here have strong feelings about their game engines)
 

cepheiden

Educated
Joined
Nov 14, 2011
Messages
37
cepheiden
It's probably also easier to explain to the player, and overall it's better to have a few large systems that govern a lot of things than many small systems that each govern a few things. Interconnectedness is good.

Very good point.
I was tending to either 3 or 4, but seeing as I already have a stamina system, yet another system would have been too much.

I tried your game, but since I rarely play platformers I can hardly give you qualified feedback.
It's fun shooting those guns and also quite challenging. Especially if you like to just shoot, like me, and then figure out you can't get over the next point because you used up all the ammo.
The sensivity for the sniper rifle seems somewhat fast and at least in the web version, it's difficult to aim, because it moves the camera once you get too close to the edge.
 
Last edited:

DakaSha

Arcane
Joined
Dec 4, 2010
Messages
4,792
Want to mention that anybody interested in seeking out a new engine should definitely try one of the cocos2d versions. As a huge c# fan, I'm even starting to fall in love with the least developed cocossharp version
 

Pope Amole II

Nerd Commando Game Studios
Developer
Joined
Mar 1, 2012
Messages
2,052
Been writing some flavor texts for the next X Caeli demo this weekend. Boy, I dunno how broken my english is (or how good of a writer I am, for that matter), but I sure do love writing a sardonic, egocentric, hypocritical, cruel stargod. Why so few games have guys like these as protagonists? Why it's always some bland as hell goodie two shoes with zero personality? Or a brooding mercenary anti-hero?

I won't say that protagonists like that never existed, but the point is when they existed they were pretty good - someone like Caleb, you know, who is very dark and totally enjoying it.
 

zwanzig_zwoelf

Guest
Been writing some flavor texts for the next X Caeli demo this weekend. Boy, I dunno how broken my english is (or how good of a writer I am, for that matter), but I sure do love writing a sardonic, egocentric, hypocritical, cruel stargod. Why so few games have guys like these as protagonists? Why it's always some bland as hell goodie two shoes with zero personality? Or a brooding mercenary anti-hero?

I won't say that protagonists like that never existed, but the point is when they existed they were pretty good - someone like Caleb, you know, who is very dark and totally enjoying it.
<insert joke about Russians and their strict mothers here>
 

J1M

Arcane
Joined
May 14, 2008
Messages
14,631
cepheiden
It's probably also easier to explain to the player, and overall it's better to have a few large systems that govern a lot of things than many small systems that each govern a few things. Interconnectedness is good.

Very good point.
I was tending to either 3 or 4, but seeing as I already have a stamina system, yet another system would have been too much.
I like when the calculation for a system is something that you can approximate without the aid of a machine. If your calculation is too complicated to explain to a player, it is a lot more likely to have bugs or game-breaking edge-cases. Meeting this condition doesn't require a trivial calculation. You can still do something like (raw damage * (1.0 - deflection %) - absorption #).

You have to decide what role you want armor to serve in your game. Do you want it to be a linear progression that improves with the party's wealth? Is it a decision the player makes to choose agility over durability? Does each piece provide a unique form of protection like life drain or cold immunity? etc.
 

Duckard

Augur
Joined
Aug 14, 2010
Messages
354
I like when the calculation for a system is something that you can approximate without the aid of a machine. If your calculation is too complicated to explain to a player, it is a lot more likely to have bugs or game-breaking edge-cases. Meeting this condition doesn't require a trivial calculation. You can still do something like (raw damage * (1.0 - deflection %) - absorption #).

This also allows you to test out the resolve mechanics on tabletop before going in and implementing them.
 

r3jonwah85

Savant
Joined
Sep 1, 2013
Messages
211
Location
Sweden
Anyone else tried the new networking system in Unity 5.1? Adding multiplayer to my gravity manipulation prototype and it has taken me a couple of days to change my thinking into networking, but now I can get most things spinning the way I want (first time doing network coding so they seem to have managed o do it rather simple to create multiplayer games). I have one problem however, how do you send a command from a non-player object? Or rather, how do you tell the server anything from a non-player object? In my case I want to synchronize the states of the lighting in the scene (scripted dynamic stuff) since if the second player is connected some time after the host the scripted event should be synced in time with the host as well. And I do not want to sync each and every lighting object that is controlled by the scripted event (since that seems very wasteful and clumsy) but rather just connect client -> tell server we connected (easy enough on the network manager, but I want to do it from the scripted event script, otherwise it gets messy real fast) -> send current state from server to client -> all is up to date and server can now continue the scripted event.
 

Abelian

Somebody's Alt
Joined
Nov 17, 2013
Messages
2,289
Is this one of the entries in the eminent, yet elusive, ~Qwinn Trilogy?
 

zwanzig_zwoelf

Guest
If skills like those would pass from generation to generation, I suggest that Zed should fuck a female programmer and send me the daughter so I can add my writing and music skills and raise the ultimate beast that will kill all indie game developers.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom