Jump to content

  • Log In with Google      Sign In   
  • Create Account

Nypyren

Member Since 19 Aug 2002
Online Last Active Yesterday, 11:28 PM

#5279917 Has anyone ever ported a ps2 game to pc?

Posted by Nypyren on 06 March 2016 - 11:41 PM

My experience is similar. We targeted console platforms, but several of our porting contracts had a (barely) functional PC version we used for development purposes. It lacked a bunch of stuff. You could only play in a window and you HAD to use a gamepad (mouse and keyboard didn't work at all). The main menu didn't quite work correctly - typically you would launch the game with the level identifier you wanted and it would just load directly there with basic character equipment. Cheat menus were added to do the rest.

Most of us had devkits though, since the large companies we contracted for had a huge stockpile of them and would ship them to us for the duration of the project.


Here's a handful of things I can think of off the top of my head, but there are likely more:

- Add mouse and keyboard support: GOOD camera controls, tooltip-icons for keys and mouse buttons, keyboard binding option screen (Us PC gamers hate it when you can't rebind keys).

- Add options menus with graphics options. Old PS2 games almost never had resolution or graphics detail settings, and us PC gamers ALWAYS notice and rightly complain about hastily ported games that overlook these.

- Redo textures at a higher res. PS2 texture quality is crap due to space limitations (the limit on PCs is much, much higher), and you should have artists spend some time increasing their quality.

- Redo meshes with more detail (try to keep the same rigs and animations though - some games had their animations tuned precisely to behave in specific ways, and changing these risks breaking the game's behavior in hard-to-detect ways).

- Add task-switching (ALT+TAB) support and a menu option to exit to the OS. PS2 games had neither. Alt+Tab support can be more painful than you'd think. Don't underestimate it.

- Make sure the game works with a variety of different gamepads, assuming you keep gamepad support from the original. PC gamepads come in a wide variety and they don't always work with identical code in the same way. Don't just assume everyone has a 360 controller.

- Depending on the graphics and sound libraries the original game used, you might expect to spend quite a lot of time fixing/replacing them for PC.

- File system stuff will be slightly different (easier). Many of the older consoles had memory cards which were a pain to deal with due to all of the possible hot-swapping cases you had to test for. You can probably comment out most of that stuff and just keep the no-free-space handling code. You'll likely want to add file system permissions checks.

- Add an Installer. PS2 games just insert the disk and run. On PCs you have to install them somehow (via Steam or via a disc or whatever).

- Test on Intel, AMD, and NVidia GPUs - as many different models as you can afford. Many a port has been ripped to shreds by gamers due to developers only testing on NVidia cards.

- If the game had an online matchmaking service (pretty rare back in PS2 days), it's likely no longer running. You'll need to host your own (or, if you're contracting for a publisher, have the publisher's online services team host it), and update URLs/IP addresses that the game uses to connect, OR take the drastic measure of ripping out multiplayer.


#5279896 Has anyone ever ported a ps2 game to pc?

Posted by Nypyren on 06 March 2016 - 07:26 PM

It's easier than making the same game from scratch, but harder than just recompiling the source code.

Without any other information about what you want to port, it's impossible to narrow it down further.


#5279876 Determining amount of taggers per round

Posted by Nypyren on 06 March 2016 - 02:47 PM

What is the best way for me to determine how many taggers I should have per round in my game?


It requires playing to find out. Allow the players to change the ratio.


#5279306 Best comment ever

Posted by Nypyren on 03 March 2016 - 11:45 AM


// TODO: Change this code before 2038.
biggrin.png:D Do you have context for this comment?

I'm guessing Y2K 2: the thirty two bittening


Yup. It was next to some 32-bit time-related code.


#5279166 make c++ more like glsl

Posted by Nypyren on 02 March 2016 - 11:15 PM

https://github.com/gwiazdorrr/CxxSwizzle


Good god that is some voodoo right there... I pity the compiler.

Comment from the code:

//! Array needs to be like a steak - the rawest possible
//! (Wow - I managed to WTF myself upon reading the above after a week or two)



#5279153 How C++ Programs Are Compiled (A Brief Look)

Posted by Nypyren on 02 March 2016 - 10:02 PM

Probably not?

When i = 29, a = 29. At the end of that loop, i is incremented to 30, and breaks the for loop. The for loop will only tick when i < 30, it may not be equal to thirty.



for (int i=0; i < K; ++i)
{
   // This code is executed K times
   // (OCD disclaimer 1: normal cases where K >= 0 && K < int.MaxValue)
   // (OCD disclaimer 2: and where the optimizer didn't optimize out the loop.)
   // (OCD disclaimer 3: and where 'i' and 'K' are not modified in any other way than what is seen here.)
   // (OCD disclaimer 4: and where the processor, RAM, etc. do not have hardware defects.)
   // (OCD disclaimer 5: and where the thread/process/computer is not shut down abruptly.)
}
(OCD edit: forgot the "int")
(OCD edit 2: moved the first disclaimer to line up nicer with the others)


#5279141 "It's when you...", or: little things you've discovered about...

Posted by Nypyren on 02 March 2016 - 08:31 PM

The git integration in VS2015 is limited; it can't currently handle SSH-secured Github-style remotes for some reason (no SSH auth, seriously Microsoft??), which means I can't use its fetch/push functions on our github repos at work (all local operations still work though). It only works perfectly with whatever authentication method VSTS uses.


Really? I could have sworn I'd used it with my personal BitBucket which should require SSH. Maybe I don't have my account configured properly.


It could be a problem specific to our company's GitHub installation itself, too. It has funky issues like not being able to clone from https://... even when I use command line or TortoiseGit (and that might be why Visual Studio also fails, if it's only able to use https endpoints or something). It only lets us clone using the git@whatever:...git format endpoint.


I didn't try any other git repos other than my VSTS and my work ones so far. My BitBucket repos are in mercurial right now, too. sad.png

(edit) I tried it out with a random public github repo and it clones it just fine. I didn't try any operations that would require account authorization (pushing), though.


#5279114 Best comment ever

Posted by Nypyren on 02 March 2016 - 05:35 PM

// TODO: Change this code before 2038.



#5279101 best way to write clean code

Posted by Nypyren on 02 March 2016 - 04:44 PM

the WHY, is not written anywhere in the damn code


This is the #1 most important thing to use comments for, which self-documenting code-without-comments can never do, in my opinion. I look through my old code I wrote 5 years ago that doesn't have explanations about WHY I'm doing a certain thing, and I think "OK, I know WHAT this code does. But WHY did I do this? What was the problem that I was solving that I needed to do this particular strange thing?"

Writing a little story in a comment describing the specific problem in detail, so that someone (or your own self) who comes in later can read that story and understand why this code matters - why it shouldn't be simplified or removed entirely, or replaced with a "better" rewrite (or maybe to solidify the decision that a rewrite is indeed the better way to go).


#5278954 Curious About Diablo 2's UI Design And Tools

Posted by Nypyren on 01 March 2016 - 11:18 PM

Visual Studio 6.0's dialog resource editor is meant for Win32 dialogs only, but you could create a tool that converts the positioning information. I really doubt Blizzard did that. It's not a good fit for making game UI.


#5278941 What to focus, where to start

Posted by Nypyren on 01 March 2016 - 08:16 PM

Spend a little time with the most obvious options (you mention WPF and Unity) and "test the water". Force yourself to learn them enough to know how to do one of your specific goals, as kind of a "technical feasibility challenge" to yourself. You will not be able to properly judge their fitness for your goal without trying them out and learning what lurks below the surface.

Start with tutorials. WPF and Unity both have an immense amount of free tutorials all over the web. You will probably not find tutorials that tell you exactly what you need to know, but you will find some that are close, and those will get you familiar enough that you can figure out what to change in order to get what you actually want.

Search for examples of what other people have done with WPF and Unity - see if they are similar to what you want to do. Analyze their approaches. Try their code (if applicable). Learn their ideas. You can find a LOT of cool ideas and source code just by searching the internet for free examples.

Most importantly: Never worry about "wasting" time during the exploratory phase! Even if you use WPF for a month and never use it again, your experience is permanent knowledge you've gained which will help you elsewhere.

At this point you will have gained some experience, decided whether you like the approach, and more importantly figured out in more detail what you don't like and what you need. You will know which questions to ask when deciding whether to use alternative systems, and you may even decide that the first approach you take is actually good enough to keep going.

Don't try to do things perfectly the first time - it's impossible. Jump right in. Don't worry about making your game perfect. You can always change things. Make it fulfill your functional goals first, and then make it look good afterwards.


#5278221 best way to write clean code

Posted by Nypyren on 25 February 2016 - 09:24 PM

1. Do not litter your code with comments.
2. Do not trace log. It looks ugly.
3. Do not implement features that force you to compromise on the aesthetics of your code.
4. Avoid fixing bugs that require an awkward fix.
5. Ignore errors and exceptions. Error handling often stinks up your fresh code. Also usually involves one or more lines of trace logging.
6. Bury all logic in layers of abstraction. If a coder can look at a method and understand how it's doing what it's doing, then you've not abstracted enough.


7. Never use a winking smiley face to convey your intent.


#5278218 "Modern C++" auto and lambda

Posted by Nypyren on 25 February 2016 - 08:27 PM

Nice language features are great for productivity, but sometimes they lead to terrible code when someone doesn't grok what they're writing.

For example in C#:
 
someList.ForEach(x => Process(x, someOtherLocalVariable));
Who would write such a monstrosity? This is what you should write:
 
foreach (var x in someList)
{
    Process(x, someOtherLocalVariable);
}
Some people don't know that the first case is going to generate a hidden class with a member variable and method just to capture the variables it needs. The ForEach method is going to invoke that generated method each iteration of the loop, adding call overhead.

C++ would probably know how to optimize such code out, but in C# we can't be so confident about the optimizations we'll get.


#5277820 How to all the coordinate systems relate to each other?

Posted by Nypyren on 23 February 2016 - 10:06 PM

I always got the impression that these were coordinates in world space.


So, the numbers are just numbers. Like "2" could be miles or kilometers if you wanted it to be. In a miles/kilometers analogy, 1.6 kilometers-per-mile would be the transform between the two systems. Coordinate systems and matrices and vectors can be thought of in the same ways.
 

My question is what values would be in the world matrix? Would the world matrix consist of the desired location in world space I would want to place my model object onto?


The easiest way that I've found to visualize what's inside a matrix is:
 
                                                   x y z w
New X Axis direction relative to the old X axis = (1,0,0,0)
New Y Axis direction relative to the old Y axis = (0,1,0,0)
New Z Axis direction relative to the old Z axis = (0,0,1,0)
New Origin position relative to the old origin  = (0,0,0,1)  // also called 'Translation'
(Caveat: depending on the convention, the rows should be columns instead. I've written it this way so I can label the "rows" in ASCII.)

Basically, if you imagine an untransformed "coordinate system" as four ideas:

- Which direction the X axis goes (obviously it goes in the 1,0,0 direction)
- Which direction the Y axis goes (0,1,0)
- Z axis (0,0,1)
- Where the origin is (0,0,0)

When the matrix has 1's down the diagonal and everything else is 0 like I've written here, that's the "Identity" matrix. When you multiply a vector or another matrix by this matrix, the output is the same as the input.

Rotation matrices put values in the upper left 3x3 corner of the matrix which, if you drew those rows as if they were at the arrowhead of an axis line on a graph, look exactly as if you had rotated the axis lines themselves.

Scale matrices also modify the upper left 3x3, but only along the diagonal portion. If you drew those rows as axis arrowheads, it would look as if the axis indicators were stretching.

Translation matrices put their X,Y,Z values directly in the X,Y,Z elements of the 4th row.


You might be wondering what the heck the 'w' column of the matrix is for...

There are two major types of vectors in 3D models: Positions, and Normals. Normals need to rotate when the model rotates, but their X,Y,Z values are relative to the vertex they're on, so they *shouldn't* be affected by the translation part of the matrix. Positions need to rotate and translate.

The "w" part of a vector allows it to control whether or not to ignore the translation row of the matrix (which gets multiplied by the 'w' part of the vector)

Position vectors use (x,y,z,1).
Direction vectors use (x,y,z,0). Normals are direction vectors.

When w is zero like it is in the Normal, it zeroes out the result of the multiplication with the Translation part of the matrix, which causes it to be "ignored."

If you look back at the identity matrix, you'll see that the three axis rows are 'Direction' vectors, and the Translation row is a 'Position' vector.

Multiplying two matrices together effectively computes the same things as if those four rows are vectors themselves.


#5277359 "Assertion failed! Expression: !XMVector3Equal(UpDirection, XMVec...

Posted by Nypyren on 21 February 2016 - 06:25 PM

I think that assert is saying "I don't want the up vector to be (0,0,0), but it is. :("

Somehow your up vector is becoming zero.

Some likely possibilities for how that's happening:
- You're setting it to zero somewhere, perhaps a typo.
- You're multiplying it with zero.
- You might be performing a cross-product on two parallel vectors (or a vector with itself via a typo).




PARTNERS