Jump to content

  • Log In with Google      Sign In   
  • Create Account

Nypyren

Member Since 19 Aug 2002
Online Last Active Today, 02:38 PM

#5297417 Should video game mechanics be scripted?

Posted by Nypyren on 21 June 2016 - 01:27 AM

I'm with Hodgman; scripting languages are just another way of telling a computer to do something. But I also want to describe the decision making process you should use when thinking about using multiple languages in a project, regardless of whether they're scripting languages or "major" languages:

I'm of the opinion that a project should minimize its complexity. In programming, Complexity == Burden. And multiple languages can be a big complexity.

Burdens may include (but are not limited to): Programmer inexperience with the scripting language and its APIs, interop overhead between the language and the host code, weaker performance, worse debugging, inferior IDEs, and poorly-maintained documentation.

There needs to be some major benefit you get from using multiple languages that offsets the burden. Perhaps you can change scripts and have them take effect while the game is still running, making iterating on new ideas much faster. Perhaps you can use scripts to hotfix something in an iOS game that you'd normally have to put in a new release and wait two weeks for Apple to approve. Things like that. And on rare occasions, you use another language because you must.

I've been on projects where we have:

- Unity engine (C++, Java, Objective-C and C#).
- C# 3.0 w/ .Net 3.5-equivalent BCL for the game code.
- Java code for Android plugins, using an inconsistent mess of build scripts for ant and gradle, with projects in Eclipse, NetBeans, or IntelliJ.
- Objective-C and C++ code for iOS plugins.
- C# 5.0 and different BCLs for WP8 and WSA plugins and host project (which is incompatible with the C# 3.0 game code in small but extremely annoying ways; thanks Microsoft and Unity!).
- PHP, Java, AND Python for the web services the game talks to.
- Perl, PHP, Python, Bash, Java and C# command line utilities (someone fucking wrote a command line tool in PHP, I shit you not).

It's just a fucking nightmare. It's job security, but almost to the point where you can no longer ship the game due to the burden.

I highly recommend thinking VERY carefully about whether you NEED that additional burden, or if it would be simpler to just stick with one consistent codebase.


#5297239 Is there any reason to prefer procedural programming over OOP

Posted by Nypyren on 19 June 2016 - 12:42 PM

ALL programming consists of functions that operate on data, though.

I've been programming for so long that the distinctions between programming styles no longer mean anything to me. They're just different representations of the same underlying processes. It's just a matter of how conveniently the language lets you represent what you want to do. The specific thing that the program needs to do is what I'm interested in - it lets me decide how I want to implement it. This is why I didn't like your example; it doesn't do anything, and there's no context for why you might want to encapsulate that integer or not, so there's no need to pick a particular solution.

You should use whatever style you prefer, based on your knowledge of the problem you want to solve and the possible options the language and APIs allow you to pick from.


#5297052 Oculus DK2 ghosting/low-persistence issue

Posted by Nypyren on 17 June 2016 - 06:45 PM

Sounds like something that happened to one of my Logitech mice; its onboard firmware got corrupted so that its "onboard" profile wouldn't send clicks. I had to plug in another mouse to access the configuration software. The physical buttons were fine, and once the config software told the mouse to run in "game detection" mode, it could click fine.

I ended up giving up and getting a new mouse, but obviously DK2s are a bit more expensive than that.


I would try re-flashing its firmware and see if there's some way to factory reset it.

If not then it's likely your device is permanently damaged...


#5295135 Help With Serialization

Posted by Nypyren on 05 June 2016 - 02:41 PM

Here's what I would change:
 
public PlayerProfile LoadPlayerProfile()
->
public static PlayerProfile LoadPlayerProfile()
Game1.PlayerProfile = Game1.PlayerProfile.LoadPlayerProfile();
->
Game1.PlayerProfile = PlayerProfile.LoadPlayerProfile();
This will allow you to load the profile without instantiating a "placeholder" instance that gets overwritten immediately.

My personal habit is that any time I see a function that doesn't use any member variables of the class it's in, and isn't virtual, I make it static.


#5295040 Help With Serialization

Posted by Nypyren on 04 June 2016 - 10:53 PM

That's C#, and the BinaryFormatter is capable of serializing cyclic digraphs (i.e. anything). Those functions should work as written. Can you post those your other code as well?

They will work, however your deserialization method should be static. How are you calling it? Are you making a PlayerProfile instance, deserializing the data, and then throwing away the return value? That would be your problem, if so.

The BinaryFormatter.Deserialize will create new objects; it won't fill in the fields of your existing object.


#5294751 How difficult is this instance of this puzzle?

Posted by Nypyren on 02 June 2016 - 11:22 PM

I got the small words almost immediately by hand (frequency analysis; got every letter used 3 or more times on the first guess), but had to use an online solver to get the large ones. The online solver got the whole thing instantly. I can't brute force dictionary words in my head like it can.


#5294268 Virtual functions are not called from a static library

Posted by Nypyren on 31 May 2016 - 12:04 AM

Sometimes, if the debugger is confused enough, it won't be able to find the memory address that it needs to place a breakpoint on. Sometimes it'll tell you this, sometimes you can miss it.

If a breakpoint suspiciously fails, try logging something - your code might indeed be executing.


#5293502 Do you usually prefix your classes with the letter 'C' or something e...

Posted by Nypyren on 25 May 2016 - 11:51 PM

My keyboard doesn't have a '' key. So I an't prefix my lasses. :(

It's pretty hard to ode in /++ or #.


#5293066 how much PC do you need to build a given game?

Posted by Nypyren on 23 May 2016 - 09:41 AM

(For some reason quoting your last post pulls in a ton of font formatting info, so I'm avoiding that.)

RE: Windows background processing:

Right now, monitoring process use on Windows 10: I have about 70 processes running, and about two dozen of them are using "0.01%" of my CPU at any given time. The rest are using 0%. It's insignificant, at least for me.

The only time I ever notice a "background process" sucking down CPU time is at work where our mandated Kaspersky antivirus software does its periodic scans that bring my work laptop to its knees. But that was true in Windows 7 through Windows 10, and isn't the OS's fault.

Back when CPUs were just getting two cores, I noticed a big improvement when I got my first 2-core PC, but I haven't noticed any difference in background task handling since then.


#5292911 Issue with convertion C++ code to C# for TGA loading

Posted by Nypyren on 22 May 2016 - 01:21 PM

If you tested the C++ code with the image you're using, and it works, then the image isn't relying on cross-scan packets (programs that save the TGA files sometimes intentionally split runs when the end of a scanline is reached). In that case there's probably a bug in your transliteration of the C++ code.

The main gotcha that I have run into when transliterating C++ -> C# is the differences in implicit casting between different sizes of integers that C# uses.

What I would do next is run the C++ and C# code in debuggers and step through them in parallel with the same TGA file until you see where values diverge.


#5292690 how much PC do you need to build a given game?

Posted by Nypyren on 20 May 2016 - 02:35 PM

Cache is part of the CPU and cannot be purchased separately.

If you want to build a PC from parts, this is the process I use:

- Find desired CPU in my price range.
- Find desired GPU in my price range.
- Find a motherboard that is compatible with both (Supported CPU socket type/generation, PCI Express version).
- Find a case which is large enough for everything (Large video cards can sometimes be too large to fit in certain cases).
- Find RAM that is compatible with the motherboard (there are RAM compatibility lists provided by motherboard makers). Buy them in bundles, not separately. Bundles are tested together.
- Find a good quality PSU with enough watts to feed your CPU and GPU.
- (Optional) Get an aftermarket CPU HSF (Heat Sink + Fan) if you want it to be quieter/cooler than the stock HSF. These are specific to the CPU socket type, and you also need to make sure the motherboard layout has room if the HSF is large.
- Find a SSD/HDD with zero customer complaints related to hardware incompatibility and minimal complaints about failures.

My current PC is:
CPU: AMD FX-6300 (midrange)
GPU: Nvidia GTX 980 (high end)
MB: Gigabyte GA-990FXA-UD3 (midrange)
RAM: 32GB (4x8GB) G-Skill Ripjaws X (midrange)
Case: Cooler Master CM690 II
PSU: Corsair 750-watt (This is way more than I need for my PC but I reuse it each time I upgrade so it's somewhat future-proof)
HSF: Zahlman CNPS 9500

Overall this is a "high end" PC for my use cases simply due to the GTX 980's outstanding performance and the fact that most games I play are GPU-bound. This PC would be overkill for game development.

Suggestions:
- Take all benchmarks with a grain of salt; I have had a perfect time with AMD processors even though they look terrible according to benchmarks.
- AMD CPUs and compatible motherboards are MUCH cheaper than Intel's.
- AMD's motherboard chipset drivers are much more reliable than Intel's. Intel tends to be really flaky when it comes to drivers.
- Nvidia is far better at supporting new games with updated drivers than AMD is. However, as a game developer you MUST test on both.
- For game development, buy midrange GPUs of both brands so you can tune your performance and cater to a larger audience.
- Try to get your game to use 4GB or less. The more RAM you use the more likely you will cause your players' unknown amount of RAM to start paging to disk, which kills performance.


#5292341 What is the top factor for MMO engines limiting world size?

Posted by Nypyren on 18 May 2016 - 02:47 PM

If the game world was huge you could travel for hours before encountering another player, and all the players would congregate in cities leaving the rest of the game world a boring empty ghost town.


You've just described Elite: Dangerous! :)


#5290158 Colorimetry: Violet

Posted by Nypyren on 04 May 2016 - 05:09 PM

https://en.wikipedia.org/wiki/Photoreceptor_cell#Humans

The cells receive WIDE ranges of frequencies that all overlap (see the frequency response graph on the right of that section). If they received a narrow range, "visible spectrum" would be constrained to those small slices of wavelengths. Each cone variant is biased towards a particular frequency range, but it can still receive the other frequencies as well.

The 'colors' we see are the ratios between the strengths that the different *overlapping* cone types receive. This is also why the RGB output of monitors APPEAR to reproduce colors representing frequencies that they don't actually emit.


#5290156 How can I share a .exe game?

Posted by Nypyren on 04 May 2016 - 05:05 PM

You could use an obfuscator to make decompiling slightly more of a hassle.

https://en.wikipedia.org/wiki/List_of_obfuscators_for_.NET


#5289821 witcher 3 combat

Posted by Nypyren on 02 May 2016 - 09:08 PM

The Witcher 3 would work in first-person. It would just make you motion-sick; combat is full of side-stepping and dive rolls. There's only one first-person game I have played that has the same amount of dodging: Lichdom: Battlemage. That game makes me motion sick extremely quickly, probably due to the crazy ways the camera moves during fast-paced combat.

Skyrim can be played both first person and third-person. In first-person you miss a lot of the cool-looking attack animations that your character is doing. Melee is kind of dull - you have one block move and two attack moves. Attack responsiveness is terrible (cooldown, no good feel of flow or chaining attacks). Enemies can block you in absurd circumstances which feels terrible (same problem in Fallout 4 - people can block a chainsaw with their bare arms).

I think the only games that I'd say have good combat systems are fighting games like the Soul Calibur series. Everything else is kind of "meh" after a while. I like Skyrim and Witcher for the exploration aspect much more than the combat.




PARTNERS