Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Nov 2005
Offline Last Active Today, 05:32 AM

#5301474 Slavery, Include Or Not?

Posted by LorenzoGatti on 20 July 2016 - 01:38 AM

In a honest and realistic game about triangular trade, the player has to be able to trade slaves, and trading slaves has to be a major part of any good strategy (because there aren't enough other commodities that can be exported from Africa). This gives the players a choice between being evil in the game's fiction and losing the game.

If you don't want a grim/educational game in which slavery is a moral issue or a callous game in which slavery is appreciated as a smart business plan, the main way out of the dilemma is not making the game about ship trading after all, to avoid the use of slave trading as a move within the game. For instance:

  • The popular Puerto Rico boardgame is about developing an American colony with city facilities and plantations. The masses of slaves working at whatever the players build are completely implicit: "workers" in the game arrive by ship in small numbers, and represent (with some ambiguity) European emigrants and big shots.
  • A game about pirates robbing random ships would make the players not responsible for loading a particular ship with slaves, and rules about humanely and usefully recycling captured slaves as pirates, colonists etc. instead of selling them might be reasonable

#5299453 A Game Design Idea

Posted by LorenzoGatti on 07 July 2016 - 01:49 AM

Since you seem already aware that approaching a large project alone without experience is an irrationally optimistic endeavour, I'll just point out less fatal issues:

  • You might be underestimating your difficulties with English vocabulary and grammar (a time machine "conflicting" the future, a  "highly technology advanced world", a "loveable" future, "reciting" your idea, and so on): a potential major problem for in-game dialogue, for promotion of your game, and possibly for collaboration with others.
    You have studied English well enough to make your native language not obvious, but much remains to be acquired. Read more English books and articles.
  • You don't appear to be starting your game design process from the beginning.
    For example, you mention "a very detailed non-level-based system", but details and levels of what? I can guess you mean, in a RPG context where the "intelligent boy" is the protagonist, character details and the traditional design pattern of experience levels, but the mentioned premise of a time-traveling boy in trouble is suitable for many different types of game.
    Even worse, how can you tell you want character details and you don't want experience levels before you establish the design objectives of your game rules and at least a vague idea of what the player would do with them?

#5297556 Storing Signed Distance Fields

Posted by LorenzoGatti on 22 June 2016 - 03:24 AM

  • Do you need to combine elementary distance functions and render their sum, product etc. (for example, "metaballs" composed of several spheres)?
  • Do you really need to keep around SignedDistanceFunction objects, i.e. old brushstrokes? Forgetting them after applying an "edit" once would seem the most efficient course of action.
  • What do you need to store in your voxels, apart from the 1-byte material code?
  • How are you going to render your voxels? Their representation has to be suitable.

#5296301 Using Pathfinding Efficiently

Posted by LorenzoGatti on 13 June 2016 - 04:03 AM

I strongly recommend using a profiler; in particular, line_profiler, which works with Python 3 and gives line-by-line data. 

In this particular case a profiler would give you not only timing data, but also an immediate indication of abnormal counts of function calls. For example, in a map with enough impassable walls A* should expand only the nodes on the optimal path and the adjacent walls; if it expands more you have a bug

#5293510 Plane equation, + or - D

Posted by LorenzoGatti on 26 May 2016 - 12:51 AM

If you like dot products, Ax+By+Cz+D=0 corresponds to (A,B,C,D) dot (x,y,z,1)=0, consistent with the popular use of homogeneous coordinates with 4 by 4 transformation matrices and 3D points (x,y,z) conventionally represented as (x,y,z,1).

#5292593 how can neural network can be used in videogames

Posted by LorenzoGatti on 20 May 2016 - 03:08 AM

It's interesting to see that the consensus regarding NN in games seems to be changing.

Consensus is a strong word. The recent developments of neural network algorithms and computing power are extending the range of things a reasonably expensive NN is good at, but whether they overlap with the useful AI tasks needed in a certain game depends on the specific case.

#5292020 Difference Between 2D Images And Textures?

Posted by LorenzoGatti on 17 May 2016 - 02:50 AM

As assets, an "image" is usually meant to be displayed very faithfully and with little processing, like the mentioned sprites and prerendered backgrounds, while a "texture" is meant to be used for texture mapping and therefore displayed with extreme deformations and transformations and drastically affected by the positions of lights, objects and cameras.

#5290824 Is using the Factory or Builder pattern nessesary?

Posted by LorenzoGatti on 09 May 2016 - 10:45 AM


Yeah, that ^^ :D


Patterns should never be a play-book for writing code. Patterns are, well, patterns in code that just so happen to have been repeatedly reinvented, at which point people recognised the pattern and assigned a name to them to make discussion easier. You should look at lists of patterns more like a traveller's dictionary, and less like a cookbook.


A software engineer should strive to be comparable to a chef who writes cookbooks -- not a machine that only knows how to follow them.


Well put! :D


So, if I don't want to, I shouldn't use the factory/builder pattern "just cause"? Correct?  As stated above there should be a legitimate reason to implement it.


Many thanks for the reassurance.


In your humble opinion, is doing this:

International international = new International(id, firstname, lastname, documents);

Okay? Given that it accomplishes what I need, and I fully understand what it does.


It's not a matter of "wanting": without the proper context of many similar classes and of client code that is content with some abstract interface but somehow doesn't care about some details of their creations, writing a meaningful factory is impossible because you don't know.what the factory can abstract and hide compared to directly calling constructors.


(It goes without saying that in your example you have either only one class, ("International", which should be just "Client"), or completely unrelated ones without a real common interface, and there's no apparent way to create your objects without passing all data up front)

#5290757 Is using the Factory or Builder pattern nessesary?

Posted by LorenzoGatti on 09 May 2016 - 01:27 AM

If I understand correctly, you are complaining about Client having a list of documents which is not used in the case of domestic clients. If domestic clients having documents is something that doesn't make any sense, then I see your point. I would need to know more about the exact context in which this code is being written to make a judgement, but it seems to me it's more like "we don't currently have a use for the documents in the case of a domestic client", but that sounds like something that may change tomorrow.

It sounds like a boneheaded "optimization": crippling domestic clients by removing their container of documents allows the grand architects to maintain a simple implementation in addition to the general one that's known to be needed for international clients.


What's really different is what to do with different document types and clients having different combinations of documents, which might involve several document classes (not too likely, but possible in principle if documents have nothing in common) but not different client types (what documents they have is a detail of their state, and likely a mutable one: constraining clients with a class that can have no documents is obviously wrong).

#5290384 What does the "Most Constrained" heuristic mean?

Posted by LorenzoGatti on 06 May 2016 - 02:13 AM

It should be noted that it is an heuristic, and a cheap and dangerous one. There is no guarantee it approximates the optimal course of action, because it doesn't account for action utility.


In the example, if Mr Armor is a minor threat (e.g. he needs a free hand to fiddle with his phased force-field device and therefore he's armed with a little knife) Mr Rifle should shoot (like everyone else) the most dangerous enemies instead. After successively switching to generic enemies of decreasing priority, Mr Rifle should start shooting Mr Armor when it becomes more useful than contributing to killing another enemy faster. Meanwhile, the rest of the team switches from the last enemy they could attack to protecting and supporting Mr Rifle, since it's the most useful action they can perform.

On the other hand, if Mr Armor has a very high priority (e.g. he throws phased force-field grenades) everyone should target him; of course Mr Rifle figures out he can do it, while the rest of the team, knowing that they cannot attack Mr Armor, can either protect and support Mr Rifle if it's useful enough or attack generic targets; no need for a premature heuristic decision.

#5289854 Procedural Universe: The illusion of infinity

Posted by LorenzoGatti on 03 May 2016 - 02:16 AM

Rendering a whole universe of randomly generated stars amounts to a skybox. Whatever the player does in the game, it will be at a negligibly small scale compared to the displacement that's needed to notice any parallax error in the skybox. Only a few objects are close enough to require less cheap rendering.

I would prerender various skybox layers as much as possible: assuming we are around Earth, Moon, Sun and of course Earth and close space stations might need true realtime rendering; but Solar system planets could be a skybox layer (valid for a few minutes because they are moving); then individual visible stars and other small objects, valid for a large central region of the Solar system; Milky Way background, valid for a vast region of the Milky Way that probably exceeds the scope of a reasonable game; and finally close enough other galaxies. When the player goes to Mars, redraw satellites and planets and constellations as a luxury.

Quantitatively, bright objects are likely to be more expensive to generate according to fancy distributions than to render without storing them permanently; and if you have enough memory to display one skybox set and render future skyboxes to offscreen buffers you can easily brute-force billions of randomly generated stars over the course of a few minutes instead of doing something complex and approximate to draw a boring starfield in real time.

#5288758 OOP and DOD

Posted by LorenzoGatti on 26 April 2016 - 09:30 AM

One of the reasons that DOD is still relatively unknown outside of certain areas (game programming, high-performance computing) is because it solves a very specific problem: memory access bound performance.


But for the vast majority (IMHO) of software written today, CPU/memory bound performance is an order of magnitude less important than the much lower bandwidth issues (data access, network access, etc).


Most "typical" business software spends its time waiting for database queries or REST APIs to complete. If DOD improves your algorithm even by 1000%, that's not going to help much if the total time spent waiting for process x to complete is 90% dependent on a high latency process.  


I'm not arguing against DOD; it's very good for it's intended purpose. I'm simply attempting to explain why it's not more widely known.


But IO-bound software struggling between external systems and memory requires the same optimization techniques and principles as software struggling between memory and CPU: read data sequentially or at least in large pages, read data only once (if possible, never), organize data so you don't waste bandwidth reading unneeded data because it's interspersed with data you need, don't waste time and/or space storing redundant information that can be recomputed inexpensively from a small working set of data, and so on.

Apparently different techniques, like normalizing the structure of a relational database and organizing data structures in memory as "structures of arrays" actually serve the same purpose in the same way.

#5285229 Polymorphic uninvolved parenting?

Posted by LorenzoGatti on 05 April 2016 - 04:25 AM

Typically, UI widgets have a dual access (with base and derived types), in clearly separate places, and any casting is a very serious code smell.


Parent widgets and general functions like redrawing and event processing own and process received widgets through a base or intermediate widget type, call virtual methods and never cast widgets to derived types because they should never care about the difference.

For example, hierarchical layout of child widgets is usually managed in some intermediate "widget with children" class, which can be abstract, and which queries child widgets about what size they want to be through functions in the base widget class.


On the other hand code that creates widgets knows their types exactly, allowing the use of any constructor of any widget type (a large part of code that needs a specific type), and allowing specific types in calls to some special function. No casting needed; on the contrary, you normally pass widgets from variables of the most derived types to functions that demand a less constrained type, gradually or completely forgetting the concrete types where they are irrelevant.

#5284999 Hierarchical pathfinding. What does it mean to me/us?

Posted by LorenzoGatti on 04 April 2016 - 04:43 AM

What do you mean by portals, clusters, "abstract" paths and "on rails"? Are you asking about theory, about some library with an uncertain name, or about something in your application?

A better effort to express yourself in English appears necessary.

#5282292 My design idea - contains many elements

Posted by LorenzoGatti on 21 March 2016 - 02:22 AM

For example, game design issues include zoological issues. A "realistic-looking" bat character doesn't seem suitable for "standing on two feet" (bats ordinarily hang from above, mostly head down), or "moving as fast as Mario" (it might cautiously crawl on all fours), and it certainly can't "punch, kick and butt-stomp" effectively with its light frame and delicate little claws

But above all, why would a bat accept to confront a platformer game on its own terms, walking, jumping and exchanging blows, instead of flying and attacking in flight?