Show Posts
|
|
Pages: 1 ... 7 8 [9] 10 11
|
|
161
|
Developer / Technical / Re: 2D Game Dev CrossPlatform
|
on: August 07, 2013, 02:26:25 AM
|
|
Flash / Actionscript. Package using AIR for an iOS / Android standalone, or a PC/Mac executable. Or export to SWF and put it on the web for everyone to play in the browser.
|
|
|
|
|
162
|
Developer / Technical / Re: Bugfixes that have astounded you
|
on: August 06, 2013, 05:18:39 AM
|
6 years ago I was working on a system that wrote some data to a bunch of files on Amazon S3 (which was pretty brand new at the time), then later a batch processor ran and processed them. The problem was that we'd occasionally get errors about missing files on S3, even though when I checked them manually, they were always there. After some digging, it turned out that we were reading them just after they got written and closed, so they didn't get a chance to "propagate" yet. The server that was getting the read request didn't yet know that such a file existed in the cloud, but a few seconds later (when I checked manually) it already got updated. And that's how I eventually learned about eventual consistency in distributed databases. 
|
|
|
|
|
163
|
Developer / Technical / Re: Managing User Interface State (C#/XNA, but should apply cross language)
|
on: August 06, 2013, 04:47:52 AM
|
This big list of if/else-if statements is going to cause problems as you've noticed. One, it's hard to read and understand, and therefore debug; two, it's easy to accidentally introduce side-effects between different parts of the function. It looks to me like these "if ... else if" conditions are really doing the work of context handling: e.g. mouse click means something else depending on whether some unit is selected or not. I would pull out different contexts into separate classes, so that you can swap them in and out as the context changes. For example, here's how I structure this: mechanical actions -> game actions -> action handlers
(keypress, mouse (unit de/selected, (start pathfinding, click, ui click) resource purchased) check inventory limits)
In my code, there's one set of classes that just convert mechanical actions to game actions. There are different handlers that get swapped in and out depending on context: for example, mouse drag normally moves the game board, but when I'm in "place a building mode", there's a different one that interprets it as moving the building instead. Same with handling mouse clicks differently, etc. Then there's a second set of classes that handle game actions - these are no longer context sensitive. In my code at least, these tend to be either components on entities (if it was something like unit selected), or global managers (like inventory). They typically get their info via events dispatched by the mechanical handlers, but sometimes get coupled more closely. Does that help any?
|
|
|
|
|
164
|
Developer / Technical / Re: Recommended architecture for persisting script instances between executions
|
on: July 25, 2013, 08:44:44 PM
|
I can see two obvious solutions to this problem.
#1. Have a different Lua interpreter for ever single instance. (This just seems needlessly expensive)
#2. Save the state of your entire interpreter and load that up for each script run.
There's another solution, which a bunch of people mentioned already: Save the state of game objects somewhere, and load them as needed. Have only one interpreter, with only one state, but have it load game objects through the foreign function interface as needed, run scripts, and save them back out when they're done.
|
|
|
|
|
165
|
Developer / Technical / Re: A* pathfinding in C++?
|
on: July 24, 2013, 06:47:26 AM
|
Yeah, it's not actually A*. There is really nothing out there with a nice clean API, so this will have to do. I actually tried writing a version with a priority queue earlier, but it was taking too long.
I have an implementation in AS3 that I wrote just last week. I haven't put in on github etc because it's integrated into the rest of the codebase, but it works pretty well. Let me know if you want a copy to pull out pieces from (e.g. priority queue) or whatever.
|
|
|
|
|
166
|
Community / DevLogs / Re: Tomb Robber (Working Title) - turnbased Puzzle Platformer (Flash Demo)
|
on: July 23, 2013, 07:07:47 AM
|
Nice game! And the illustration visual style definitely looks good (although pixel art and the 8-bit sfx do go well together  ) Re difficulty - I think around level 5 I got to a point where levels were getting filled with spiky walls, and that felt a little disappointing. Without them, levels felt open ended, which was great - I could do all sorts of stuff, and experiment and figure out the level. But with spikes everywhere, the game turned into a "level designer has one particular path in mind, and I had to find it" kind of a thing, which was more limiting. In a game like this (and sokoban, and klocki, and so on), I like the opportunity to play around, not just search.  So I think I'd suggest making the levels feel a bit more open; maybe just leave some spikes etc. in key places to prevent obvious solutions, but otherwise let the player move around more? Then again, I only made it to level 6 or 7, and maybe things change vastly in the later levels for all I know... (By the way, I peeked at 14, and those mud bricks and death bricks look fascinating!) Good luck!
|
|
|
|
|
167
|
Developer / Technical / Re: A* pathfinding in C++?
|
on: July 22, 2013, 02:41:59 PM
|
Try reversing your priority queue for fun effects. I once did that by accident, and watched in amazement as my enemies took the longest possible valid path to get to me.  Nice. That had to be fun to debug :D Or playing around with distance heuristic. Inverting the h value (so it gets better when it's moving away, rather than approaching) made for very cheap-and-easy dynamic avoidance. 
|
|
|
|
|
168
|
Developer / Technical / Re: A* pathfinding in C++?
|
on: July 22, 2013, 11:50:41 AM
|
Orz, just fyi, this doesn't look like A*, more like a flood fill algorithm. If I'm reading it correctly, during each recursive call it iterates over all the "closed" nodes looking at their neighbors, which is a set that's growing in all directions, until it hits the target node. But A* wouldn't do that - it would pick just the node it thinks is closest to the target, and only expand in that direction. So A* would be much faster than flood fill for most cases, except for the truly convoluted maps. Wikipedia has a pretty good pseudocode algorithm on their page: http://en.wikipedia.org/wiki/A*_search_algorithm#PseudocodeAlso one word of caution: the "open set" shouldn't be implemented as a std::set data structure, it should be implemented as a priority queue, that always returns the node with lowest estimated node cost. That's how A* delivers the "head straight for the target" behavior, instead of searching through all sorts of unnecessary nodes. (Fun fact: most of the magic of A* is in using the priority queue for the open set. If you use the same algorithm but use a regular queue, you get breadth-first search. If you implement open set using a stack, you get depth-first search.)
|
|
|
|
|
169
|
Community / Creative / Re: On programmer's block, motivation and stress
|
on: July 20, 2013, 10:55:56 PM
|
also, sometimes when you don't feel like working on your game, you can at least bring up enough motivation to work on the design document; go over it, edit, add stuff, change stuff, etc. -- and often, pretty soon after working on that you'll probably want to work on the game itself too
This, many times this. Motivation can hide in strange places. Sometimes it takes merely futzing around with something tangentially related, to trigger a memory of working on something, and a desire to get back to it. Both design docs and concept art function as great sources of inspiration, not just documentation...
|
|
|
|
|
170
|
Developer / Art / Re: GIF's of games being worked on
|
on: July 20, 2013, 09:59:53 PM
|
 morph of a series of paintings depicting the physical change in the antagonist in teslagrad through his years as a regent Nice! This is very Dorian Gray 
|
|
|
|
|
173
|
Developer / Technical / Re: Tile/Map-Based Game Techniques: Handling Terrain Transitions
|
on: July 12, 2013, 07:00:27 AM
|
I advocate a rule system which can produce a whole host of different effects, like drop shadows, randomized terrain, muti-terrain transitions, tiles which only have a few rules, poser tile types, and even represents a superset of the problem that allows you to use quads if you still want to (but only in the few situations where they are appropriate). Yeah, a rule system would definitely be more generally useful - and let you customize the lookup rules in a variety of ways. People still have to figure out what the right rules are, though. What was interesting about the OP's lookup-based system, was that his system already provided the implicit rules for people (only these patterns matter, and not others), and an implementation that was optimized specifically for them. That's really useful info for people just learning about something for the first time. Still, for my own projects, I'd probably err on the side of greater generality... (By the way, you've got some cool proc gen articles on your site!)
|
|
|
|
|
174
|
Community / DevLogs / Re: Biodiversity Experiment #127 (Working Title)
|
on: July 11, 2013, 07:31:55 AM
|
What a great starting concept. This could grow in so many directions - something more like a Conway Game of Life (play with cellular automata to grow your garden), or something more action-oriented (shoo animals away or try to trap them), etc etc. This has a ton of potential! By the way, have you played SimLife? It's an old-school artificial life simulator. Your screenshot reminded me a bit of it...
|
|
|
|
|
175
|
Developer / Business / Re: Best Way to Control Demo Access?
|
on: July 06, 2013, 06:54:30 PM
|
|
I don't imagine many press / blogger people will be willing to sign an NDA, unfortunately. It's too much of a hassle - and if it's a major publication, their legal department might need to be involved etc etc.
Instead, I would just put it in a password protected directory on the web server (doesn't have to be anything fancy, just the basic .htaccess auth). This way it's no longer as easy as skyping someone a link - now there's a username/password attached as well, which should make people think twice...
|
|
|
|
|
177
|
Developer / Technical / Re: How do MMORPGs store their users data?
|
on: July 04, 2013, 05:27:25 PM
|
1) I need a prototype to be done within 11 days, then I can spend as long as I want on it 2) I should/need to learn Erlang (job), and have 17 days for that
...
And if not Erlang, then what? I could pick some language I know and all, but my main language is C++. It's tough to code a server with C++, and I have to make it work for linux and windows ... Here's what I would do if I were you: 1. Start with an existing game server, and get the "basic game" standing up like that, which should take much less than 11 days. SmartFox Server is good enough for prototyping ( http://www.smartfoxserver.com/products/sfsPro). The advantage is that an existing game server will already have implemented things like socket connections, user login, a model of "rooms" where people can move, etc. - and you implement your own game logic on top of that. If you go with SFS, those game logic extensions can be written in Java, Python, and something resembling Actionscript. 2. Once you have a working game server you can fall back on, you can consider rewriting one yourself. I'm not sure you'll have to (it might be easier to just stick to SFS). But if you do, pick a language with automatic memory management, and safety features like array bounds checking. Just please don't do it in C++. Debugging memory-corruption-related crashes in a server environment is really not fun.  I would personally write one in Java, because I know it well, using the Netty networking library (very high perf) for the networking bits. But really any high level language will work... I have no expierience with setting up mySQL by yourself on windows. Is MySQL Server Community Edition fine? Or is there something more... lightweight? As far as SQL databases go, MySQL is pretty lightweight!  The Windows edition of MySQL is actually quite good, just get the official installer, and have it set up everything for you. There should be GUI manager that comes with it, which you can use to set up tables etc. How about it?
|
|
|
|
|
178
|
Developer / Technical / Re: Navigating screens efficiently?
|
on: June 23, 2013, 09:44:00 PM
|
|
I use a stack of frames, each of them has functions like onPushed, onActivated, onDeactivated, onPopped, that are completely symmetrical - e.g. if onPushed creates an object and subscribes to an event, then onPopped unsubscribes from that event and cleans up that object. (In general, all of my objects have pairs of initialize/cleanup functions, that get rigorously called when the game mode starts up and shuts down).
So I start with a main screen, then push a selection screen, once the player selected a scenario I push an asset loading frame, then push a gameplay frame where all the action takes place - then afterwards just keep popping them (and maybe push a summary frame), until I get back to the selection screen.
By the way, watch out for memory usage reports being artificially high, because GC might not trigger automatically if the system isn't under memory pressure. To be sure, call System.gc(), to make sure it happens, and compare the results before and after.
|
|
|
|
|