Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Jun 2000
Offline Last Active Today, 04:11 PM

Posts I've Made

In Topic: Automated Space Combat (4X)

23 September 2016 - 10:43 AM

Edit: I did not realize this was request-for-suggestion on an existing game. Some of the below may be completely irrelevant or unattainable in-place.


Note that the game is focusing on grand strategic level (no tactics, no moving ships around, etc) so the combat need be only as complex as to affect the strategic layer (what ships to build, what composition of fleet to send vs a certain alien race, how many to send, which upgrades to install). The combat is presented only in an observer mode (optional), so the player can see and learn how it all works together, not to issue tactical orders.

"You have various hulls, and you need to choose their design proficiencies, and group those into fleets." Given those design requirements, my first-blanch reaction is...


You have several size classes of ship. Let's arbitrarily call them Class-1 (one- to five-man fighters, strike craft), C2 (fifty-man small vessels), C3 (five-hundred-man frigates/cruisers/support craft), C4 (I think you see where this is going), where each class is approximately twice the length (four times the cross-sectional surface area, eight times the volume) of the previous.


Every ship has the same "nominal volume" for design purposes; that is, no matter what the size class, appropriate systems for that size takes up the same percentage of volume. Every ship needs thrust and fuel, so we'll set aside a static percentage of those that are just inherently part of every design. And then you can provide sliders for all the features your tech level provides, which must all add up to less than 100%.


There can be a feature "Streamlining", which eats up volume but increases maneuverability and reduces the ship's cross-sectional size, making it harder to hit with direct impacts (beam/kinetic weapons, penetrating missiles).


There can be a feature "Shielding", which eats up volume, but adds a % deflection against damage from EM weapons (energy beams, plasma, radiation).


There can be a feature "Armour plating", which eats up volume and reduces maneuverability, but adds a % deflection against damage from non-EM weapons (kinetic, missiles, torpedoes).


There can be a feature "Point Defense Weapons", which can target fast-moving objects at close range. For every 5% you allocate here, the vessel takes its size-class in shots at valid targets in range (missiles, torpedoes, and ships two or more size classes smaller).


There can be a feature "Main Armament", which targets vessels of the nearly-same class and fixed installations such as stations or planetary structures. For every 5% you allocate here, the vessel takes its size-class in shots at valid targets in range (ships no more than one size class smaller, ships of equal or larger size, fixed installations).


When you select point defense and main armament, you also select a weapon type in particular to mount. Different weapons have different properties. Beam weapons are deflectable by shields, kinetic weapons can be stopped by armour, flak and burst weapons hit multiple ships in the same Group, hull-penetrating missiles are less likely to hit more maneuverable ships but do more damage to anything they do hit, et cetera. You can mount multiple point defenses and main armaments to have multiple loads, but all weapons of one Group and one Type (point vs. main) use the same targetting choice each combat round.


Any space unused by features is unspent, reducing the cost of the ship from its base value.



All systems have a small extra % of effectiveness for each aggregate Tech Level of difference between the two fleets. Every system also increases in effectiveness for each level of Specialization research you commit to globally (each "Specialization" research being a penalty to one system in exchange for a boon to another), or you can add or cancel out Specialization levels for a specific ship design by paying extra on a per-unit basis (in the long run, the global is cheaper, but since the global affects all your fleets everywhere, sometimes you need to respecialize to deal with a rising threat). Larger ship classes systems are more effective than equal %volume of smaller ship classes' systems, but not quite by the full factor-of-two; you need to pump Specialization in to push it to or above a 2.0 multiplier relative to the next size class down.


And lastly... when you design a fleet, you give up to two really high-level order to each Group of homogenous hulls. "Attack (a size class | "deep-strike")" or "Screen (a Group)" or "Retreat" or whatnot. In battle, a ship prioritizes fulfilling its order. Deep-striking units can attack screened groups directly, but will be attacked by the screeners directly. If an order cannot be perfectly fulfilled, the Group falls back on its second order; if that cannot be fulfilled, it starts widening the orders it's given, choosing other size classes to attack, screening a different group, or retreating if all else fails.


With that together, you have a way for race-wide affinities to emerge (global Specializations), a way to customize how you deal with specific enemy ship designs (hull Specializations), a way to give fleets basic doctrines for using your design in battle (Orders), and a need to design fleets to either deal with a broad spectrum of foes or else specialize against a particular foe (e.g. your opponent's figher-swarm tactic is defeated by having large numbers of flak-based point defense on cruiser groups, which are set to screen your anti-capital-ship beam-mounting destroyers).

There can be a feature "Armour plating", which eats up volume and reduces maneuverability, but adds a % deflection against damage from non-EM weapons.

In Topic: Ide For Linux

16 August 2016 - 12:32 PM

I want to step in here and give a few words of support for Eclipse. Yes, it's an absolute RAM-hog. Yes, it's Java. Yes, it has some confusing schisms in the plugin community (but nowhere near as bad as, say, the NPM community).


But Eclipse (and, yes, IntelliJ) have powerful refactoring engines built right in. In Eclipse, you can put the caret on any identifier, in any scope, in any window, and hit F2 (in a non-text-editor) or Alt+Shift+R (in a text editor), and rename the identifier. In every file it's referred to. Renaming files and folders if it's supposed to share the compilation unit's name. Making the necessary rename commands in the version control tool associated with the project. Checking for compilation errors, syntax problems, and conflicts and letting you see all changes being made before you have to commit to them. Searching your XML and JSON files for fully-qualified references to the classes being modified and offering to update them as well.


And that's just renames. You can also extract interfaces to new types, compose and decompose your prototyped spaghetti into separate responsibilities, change function parameter lists  (inserting default values and/or TODO comments everywhere that function is called from). Eclipse is a fantastic development environment for making your vertical feature slices, and then turning them into a real, working, comprehensible application.


If you have enough RAM to handle the half-gigabyte of overhead that just using Eclipse costs you, plus whatever it takes for its representation of your project, it does not "bog down" development; it enables it. If you take the half-hour to learn its keyboard shortcuts and its navigation features, like you would have to switching to any other IDE, it does not stay "cumbersome". I've been using Eclipse for Java application, Java+Tomcat, JavaScript, and C++ (with MinGW, but the same applies to GCC) development for nine years, and it's been at least two years since I needed to touch a mouse to interact with it for any reason except to adjust panel sizes and dock positions.

In Topic: lpCmdLine, open with and spaces

15 August 2016 - 10:00 AM

Some other very important bugs and logical slips:

  • All entries of the array 'argTexts' are going to be pointers to the same 255-char buffer 'temp', which will contain only the last argument on the command line.
  • 'temp' has a finite size and you're not checking the size of the source string first, so you should use snprintf and provide the size of the destination buffer, instead of sprintf (really, I don't know why modern compilers even let you get away with using sprintf without really loud warnings that can be promoted to errors with -Wstrict).
  • I can't find any documentation describing how sprintf (rendering to char sequences) handles conversion from wide-char strings (as per your %ws format code). Why not just call inputFileName.append(szArgList[1]), instead of using two separate char-formatted intermediates ('char* temp' and 'std::string inputCmdLine')?
  • CommandLineToArgvW only returns null if there's some critical command-line parsing failure, like unclosed quotes or passing in a null pointer. You should check the value of nArgs to determine if at least one command-line parameter was passed or not, not the nullity of szArgList.
  • If the file doesn't exist, you still try to release a Direct3D context that you never created. If that variable is uninitialized or ReleaseCOM() doesn't like getting passed null pointers, you're in for a world of hurt there.


Hope that all helps you analyze your code more critically. Even if you think this is a tiny, one-off, personal-use-only tool that doesn't need quality and reliability, these are bad habits to let yourself develop. :)

In Topic: Create A Gaming Operating System

25 July 2016 - 12:49 PM

Ah, this old sausage. One of those questions where the very fact it is being asked ("How do I X?"), is itself an answer ("You are not yet ready to even start planning to do X."). You should maybe start with learning what Linux is and isn't; that is, where Linux ends and where the software you choose to install or develop for it begins.


For a practical experiment, I'd suggest installing minimal Ubuntu Server 32-bit (yes, the GUI-less one), and then following this AskUbuntu answer ( http://askubuntu.com/a/706073 ). When you run `apt-get install steam-launcher`, you will be presented with a list of all the software that goes into a window manager, an application stack, and a piece of user-space installation management software like Steam. To develop something like Steam, you will need to write or use nearly all of it.


Having experienced that brute-force education in the size and scope of what you are asking, instead of leaping into this multi-billion lines-of-code project you are asking us to show you "tutorials" for... you can instead tackle something a bit smaller. You don't need to write a Tetris game to develop an OS, but if you can't do the former yet, you definitely can't do the latter yet.

In Topic: Trouble With Level System [Gammaker Studio]

21 July 2016 - 09:03 AM

Which wave is failing? 0, 1, 2+?


Knowing nothing of GameMaker Studio... I assume assigning a number to those Alarm objects schedules that alarm's script to run that many frames later? If not, what are those lines intended to do?


In alarm[1], what does the last line do, and are you certain that the variable spawn_rate1 is in scope at that point?