Jump to content

  • Log In with Google      Sign In   
  • Create Account

Servant of the Lord

Member Since 24 Sep 2005
Offline Last Active Today, 10:20 PM

#5304536 Problem With Cs:go Sensitivity C++

Posted by on 07 August 2016 - 03:47 PM

Well, maybe it's set to 0.0220009 (or whatever), but the display only shows up to six decimal places.

#5304365 Alternative To Equipment In Rpg

Posted by on 06 August 2016 - 11:45 AM

Just equip materia onto each ab of your monk's six-pack.  :P 

You can collect and equip things that are purely "conceptual" - Paper Mario has you collecting and equiping 'badges', but you can easily use gems, rings, or even non-physical "essences".

#5304300 Only 12 Enemies, And My Fps Drops To 30, Why Is That?

Posted by on 05 August 2016 - 10:24 PM

But the real reason is that I really didn't have the desire to test it because there was so much stuff that could go wrong and I didn't want to turn 30 minutes into 2 days, because this is what happens most of the time when I make moderately big changes to my code.

Sounds like you need a source control system. Most people use git and github; I personally use hg and Bitbucket.

This allows you to "rewind" your sourcecode days, weeks, or months, so you can spend a week experimenting, and if it didn't work, rewind to what previously worked. Basically, you can have multiple different historical branches of your code saved (and backed up online, privately, for free).

#5304299 Problem With Cs:go Sensitivity C++

Posted by on 05 August 2016 - 10:16 PM

Do not take this as offensive, but you look a little confused on this matter and I will not continue to answer you

Seeing as he took the time to try to help you, and made very reasonable assumptions, that is offensive. It's unfortunate he didn't have the perfect answer for you (none of us do), but this is exactly the methods programmers use to find answers.


His point about the command console is important to: The command console likely will display 0.022 and 0.022000 in the exact same way, depending on whether the value the console is displaying comes from (internal to the game) strings or float variables.

I seek help in relation to the performance of both values ​​and not supostes guesses among other unrelated aspects you referred to.

Debugging is the process of making intelligent guesses, and then following up those guesses with verification.

Seeing as none of us are interested in fully debugging it for you, we've offered intelligent guesses, but you have to debug it yourself.
I've basically put in as much effort as I care to.

#5304220 Only 12 Enemies, And My Fps Drops To 30, Why Is That?

Posted by on 05 August 2016 - 10:04 AM

Guys, you still haven't answered my question about precalculating and storing the matrices that hold the interpolated transformations in order to save some cpu on skeletal animation. What do you think about that? :huh:


I think it's possible it could be slower (because the CPU is fast, accessing RAM is slower, so sometimes it's faster to calculate things on the fly, depending on how much you are processing, where it's located in memory, and the cost of the calculations), but that there's a chance it could be faster, so measure it.


Also, optimize at higher levels of abstraction first (big-picture program flow) - you get some of the best performance gains there.

#5303858 Theory Behind These Uncharted 4 Bullet Trails

Posted by on 03 August 2016 - 03:20 PM

I don't know how they achieved it, but when people want thicker textured lines, sometimes they use long narrow quads.


Since the line gets distorted, imagine you had a collection of line-segments attached to vertices, with each segment actually being a thin quad.


As the wind blows on the bullet trail (or rather, as you randomly pertube the trail), you distort the line vertices in-equally, distorting the appearance trail. Further, you also fade out the quads to make the trail fade into non-existence, and don't forget the quads themselves can be animated (with subtle smoke animation).

#5303835 Mapping C++ Entrypoint Into Dll

Posted by on 03 August 2016 - 11:14 AM

The SDL api uses a #define:

#define main SDL_main

So the user's int main() becomes int SDL_main(), and SDL's library has int WinMain() vs int main(), and etc, based on the OS...


SFML does it without macroes (except on iOS), using this method:


Most of SFML offers the choice of DLLs or static libs, but for one library sfml-main is static linked, and contains the entrypoints and then calls a user-provided standard entrypoint (int main()).


#include <windows.h>

extern int main(int argc, char* argv[]);

    return main(__argc, __argv);


So if one part of your library could be statically linked (or perhaps the whole library, if you don't have any licensing kerfuffles), you could define WinMain() there, and have WinMain call main().

#5303831 Problem With Cs:go Sensitivity C++

Posted by on 03 August 2016 - 11:01 AM

Well, without seeing CS:Go's source code, it'd be hard to know the cause for sure. I was looking through Source SDK 2013 on github, but it was rather hard to follow using the github interface, and I don't want to invest the time to download it, so I'm not positive if it went through the atof() code path or not. Note: atof() does convert it to a double, and then it's cast down to a float by Valve's code; and because I didn't download the entire code, I wasn't 100% positive if it was standard atof() or a custom implementation.


But since it is values loaded from config files, I'd hold on to my initial guess that the problem is in the text-to-float conversion function.


However, judging from Source SDK 2013, it shouldn't matter during multiplayer if sv_cheats is off, and sv_cheats shouldn't be on if the server disabled it.


If you are claiming that CS:Go allows you to speed up your mouse movement by tweaking the config file, while playing multiplayer on a server with sv_cheats disabled... if all four of those variables are true: different speeds, via config files, in multiplayer, on cheat-disabled server, then that is a bug that should be complained about to Valve, because it's directly something their code (or at least the Source SDK 2013 code) explicitly attempts to prevent, but apparently fails.


Or are you claiming that CS:Go's mouse speed is different than CS:Source's? If so, comparing the two games (rather than the same game with merely different configs), that's an entirely different issue.

#5303740 Problem With Cs:go Sensitivity C++

Posted by on 02 August 2016 - 08:33 PM

You're saying, there seems to be a difference between "0.022000" and "0.022" where no difference should actually exist.


My question is, where are you finding these values?


If they are in a configuration file (a text file that the game loads), then it goes through different code logic than if the values are directly found in a source code file.


If it's in a code file (usually with the file extension: .c, .cpp, .h, or .hpp), then there shouldn't be a difference between the two, as far as I known (but I'm not particularly knowledgeable of floating point binary representations).


But if it's in a config file, then that means "0.022000" and "0.022" are text that Valve's code has to read and interpret. It's perfectly possible that Valve's code has a bug in it, when interpreting from the text symbols "0.022000" to the actual number 0.022. Maybe when trying to eliminate superflous zeros, it accidentally removes one extra character and results in 0.02 instead, for example.


Because it's odd to add extra zeros after the decimals, it's possible the bug escaped notice for quite some time.


This is pure speculation, but would be where I'd begin looking. It'd be very easy to test, with Halflife's public source code.


[Edit:] It looks like they are just using (float)atof(str), so that's a dead end. For multiplayer, they do force it to be either -0.022 (for inverting mouse controls) or 0.022, if sv_cheats is turned off.



Are you positive there is a real difference in speed between the two, or is that just a rumor?

#5303726 Character Alignment In Single Player Rpg

Posted by on 02 August 2016 - 05:45 PM

I'm going to offer some criticism, but just to be clear, this doesn't mean don't pursue your idea, it just means think about what benefits you actually gain, and whether the detriments are worth it.

In most RPGs the player is the archetypical hero fighting to slay the big bad.

Solution: Write a better story.

I envision a system where you are asked a series of alignment questions at the start of the game...

At the start of the game? That's often the worse time to ask any question.

One game design guideline is, "Don't ask players to make choices before they are knowledgeable enough to give informed answers."

(Note: Guidelines are default lines that guide you to better design, but not absolute rules. You should feel free to break out of the guidelines after you comprehend the "why" of the guideline and make an intentional decision to design outside of it for rational well-thought out reasons. But if you don't understand why that's a good guideline, then you breaking out of the guideline will likely be handled poorly)

...and that is how your character starts out.

One of the major reasons some people play RPGs is for the ability to make choices and customize their player.

This could also be done with a short series of quests, where the way you complete them determines your starting alignment.

Why not just ask me what alignment I want to play as?

Knights of the Old Republic tried to detect my alignment, but kept posing scenarios that often gave stupid options that I'd never pick, so I was forced to choose something that rarely lined up with my actual motives.

I'd often make decisions that I felt was reasonable and not-evil, and it'd give me dark-jedi alignment points for them, because the game tried to detect my motive (which was impossible for the game to know) based off my actions. You're making the same mistake.

As the story progresses, it may turn out that you are the big bad, attempting to overthrow the emporer and rule the land.

So, by branching the paths, you're quadrupling your workload, because you are making alot more content that most of your players will never see if they only play a single playthrough (and I'd guess less than 10% of your players will play more than one playthrough).

As you progress through the game, your alignment would affect things such as what kind of magic is made available to you.

That's terrible. You're removing my choices.

"Games are a series of interesting decisions" - Sid Meier

Instead of empowering me, the player, by offering me important real decisions, you're trying to have your computer detect what I would want or should have based on entirely unrelated actions I took much earlier in the game. No thanks!

Think of it: Suppose you see me kick a dog. Humans are already terrible at detecting my motive (alignment) for doing so. But not only are you terrible at detecting my motive, you're going to write code that's even WORSE at detecting my motive, AFTER limiting my choices down to three or four arbitrary dialog choices that you force on me that I'd never have chosen anyway, and use that to try and detect my motive, and then use that failed detection to try to determine how my character should behave, what he'll become, and what rewards he'll get. You're taking everything about role-playing out of RPGs.

I get it if you write a really good story, so now I'm playing the role that you have defined for me. Great! That's what books (and many RPGs) do.

But if you pretend I'm playing my own character, defined by my choices, and then keep forcing decisions on me based off of your flawed interpretations of my earlier decisions, then I'm no longer playing my character. It'd be like me trying to play my character, and you keep on overruling what I'm wanting my character to do by making decisions for me, while continually trying to pretend it really is my choice.

Although I appreciate the extra work involved, I am aiming for this game to be procedurally generated with automated quests whose goals adapt towards your alignment.

So now we have a human who is terrible at judging my actions writing code that's worse at judging my actions, and using it to generate quests that are absolutely horrendous at judging the motives of my actions.

You'd probably have better accuracy flipping a coin to determine whether I'm playing a good or evil character.


If you are using the famous D&D alignment system, Lawful and Good are on two separate axes. They aren't the same thing.

D&D has two separate axes:
Lawful <-> Chaotic
Good <-> Evil

Most villains are Lawful Evil, like Darth Vader.
Some villains are Chaotic Evil, like the Joker from Batman.

Some heroes are Chaotic Good, like Robin Hood.

Lawful/Good? Get an invitation from the order of Paladins.  Evil? Get approached by a necromancer, etc.

And what if I want to be evil and infiltrate the Paladins? e.g. Emperor Palpatine from Star Wars.

What if I want to be good, but want to try to sway the Necromancer away from the dark arts? Or what if I just go to the necromancer, not for anything malicious, but merely because he happens to be good at sewing corpses together, and I want to be a medic?

Obviously I'm not expecting you to script every possible option. All I'm saying is, if I go with the Necromancer and you ASSUME it's because I'm evil, you are making the exact same mistake KOTOR made.

Some that I've thought of are theft and assassination

Both which can be done for non-evil reasons.

NPCs will also interact differently with you.  Perhaps you get a discount from the local blacksmith because you saved his son in a side-quest, or you are shunned by the town and need to go to the black-market underbelly.

This is fine, because just as you personally are terrible at determining my motive based on my actions, so are NPC villagers. If they mistakenly think I was being evil when I killed their inn-keeper, that's a legitimate interpretation for the NPCs to make, and that legitimately can govern their behavior and actions towards me.

Party members may only join your party if your alignments are compatible (or you have high charisma to trick them into joining you).  As you adventure together the choices you make may force some of them to leave your party or even attack you, while others will "have your back".

Overall, my suggestion is not to think in terms of alignment. I believe in black-and-white morality, but I also believe your interperations of my morality based on my actions is heavily suspect.

Instead, have your world and NPCs react to actions, and constantly remember that your interpretation of the reason for those actions is always wrong. No, I really do mean always wrong. Because for any action you put in the game, if a thousand people play your game, every "evil" action will be chosen by someone for a good morality reason, and every "good" action will be chosen by someone for a bad morality reason.

The best way to handle it is for every situation where some NPCs react in a negative way, do some good writing and make some NPCs "see where [the player] is coming from".
Jeff Vogel talks about this (coming from a different angle) in his RPGs.

Here's him talking about one of his games (Geneforge):

"The Geneforge games are very morally open-ended. I have long been annoyed with fantasy's over-reliance on characters who are all-good or all-evil. I wanted to write a game where you could play through the whole storyline looking for this guy who is evil, meet the guy, listen to his side of the story, realize he has a point, and join him. And I did. It's called Geneforge.

The Geneforge games are full of factions you can join. Some are sensible. Some are insane. Some are peaceful, and some are violent. Only a few of them are truly bad people, trying to do horrible things. I tried to be truly even-handed when making the factions. When writing them, I always had them make the case for their point of view as clearly and convincingly as possible. When I wrote a faction, I was really trying to convince the player to join it.

This is what I am most proud of about Geneforge: I have gotten many e-mails that said, "I loved the games, but I had one problem. I joined [some faction], but I thought you made it too obvious that [that faction] was the right faction and I was supposed to join it." They were all convinced that I was secretly supporting their own pet faction. Hee!


Compare this with my experiences playing KOTOR 1 and 2 (which, don't get me wrong, were great games!).

KOTOR: Girl asks me to train her as a Jedi. Sure! -> MASSIVE dark side points. Apparently she was from an order that swore an oath to never learn jedi powers. I just offered to help her because: A) She asked politely and B) She was was rather cute and was basically flirting with me.  :P

She made a great apprentice though - I taught her how to dual-wield frost-blue lightsabers and had her specialize in anti-droid combat. By the end of the game, her morality was higher on the light-side than mine was.


KOTOR: Guys in shiny armor ask for my help in overthrowing a tyrant. Sure! -> MASSIVE dark side points. Turned out the people in shining armor were evil (they were nice enough to me!), and that the "tyrant" was loved by her people. K... so I made a massive mistake that NPCs should react negatively to. That's absolutely awesome. What's not absolutely awesome is KOTOR using that to try and determine that I'm playing an evil Jedi (I wasn't), and using that to limit my future options, which two hours of gameplay later seriously lead me to have zero choice but kill a half-dozen benevolent Jedi masters in some absurd bid to wipe out the Jedi order, which had ZERO to do with my actual motives and choices earlier in the game.

The two major lessons here is,
1) No matter how well you think you are setting up choices to be clearly good or evil, you still can't determine any player's moral alignment from that.
2) If you're a terrorist trying to bomb an airport, just ask me to hold your bags for you, because I'm super gullible when it comes to helping people.

Determining public reputation? That's fine. Limiting my future actions (and taking away choices) purely because you think you know what I want to do? Not fine.

#5303721 Problem With Cs:go Sensitivity C++

Posted by on 02 August 2016 - 04:43 PM

CS:GO Default:
m_pitch 0.022000
m_yaw 0.022

but if you change m_pitch from 0.022000 to 0.022 there is a difference in sensitivity which makes it a bit slower


If those are values entered into a config file, it's possible their text-to-float conversion functions are buggy, and interpret 0.022 and 0.022000 differently.

#5303671 Only 12 Enemies, And My Fps Drops To 30, Why Is That?

Posted by on 02 August 2016 - 11:16 AM


I'm still wondering, why fps would be useless number for profiling?

fps measures the entire loop, which means you only know total execution time.

Also, FPS is a deceptive measurement because it's not linear - the "cost" of each unit of FPS changes. Going from 59 to 60 FPS is not the same as going from 29 to 30 FPS.

Performance: Why did I just lose 100 FPS by drawing one triangle/sprite?


[Edit:] Lactose! already mentioned that. Oops.  :ph34r:

#5303401 Only 12 Enemies, And My Fps Drops To 30, Why Is That?

Posted by on 31 July 2016 - 09:08 PM

Enemies shouldn't "have" a deltaTime, you should just pass them the current deltaTime to their update function.

(right now it looks like you are mixing your updating, player input event processing, AI thinking, and rendering, all in one function)


I used some models from World of Warcraft. And the interesting thing is that I have the game, and when I play it( when I play WoW ), I can have 20 players around me, and my fps is great, but when I add the same models in my own game, my fps drops like crazy and it's 10 times slower than the original game, why?


Because it's not about what data you're loading, it's about how your code uses it. Well, okay, it's about the data and the code working together.


Your code and WoW's code is different, and thus your framerate and WoW's framerate is different.


(Make sure you don't use WoW's models in any copy of your game you distribute publically, btw - that's copyright infringement)

#5303122 Binary, Source Release, Libs And Dll

Posted by on 29 July 2016 - 04:55 PM

'Binary' means it is the compiled code - in this case, the libs and dlls.

'Source' means it is the source code, uncompiled. i.e. the .cpp and .h files.


The source code compiled for one operating system won't run on other operating systems. Even on the same operating system, if you are using a different compiler than me, your compiled binaries won't work with my compiled binaries. i.e. if you compile a lib and DLL using Visual Studio, I can't (easily) compile my .exe to work with your DLL if I'm using MinGW/GCC. They won't work well together if they are built with different compilers... or even different versions of the same compiler, if enough things changed between versions.


So, libraries are often distributed as source code, so each developer can compile their own version that works for their compiler, compiler version, compiler settings, OS, OS version, and OS settings (x64 vs x86 versions of Windows, for example).


The binary options are just a convenience, by providing a pre-compiled version for one or two of the most popular compilers. Even when binary options are provided, I don't use them - they just waste my time since they never work with my particular setup anyway. But if you are using a wildly used compiler like Visual Studio's, pre-built libraries are a huge help that saves a lot of hair-pulling!


Another example is, sometimes I want a library to be a dynamic library (a DLL), and other times I want the library to be a statically-linked library that gets embedded into the .exe; if a website ONLY provides pre-built libraries, they might not give me the version I want, but if they provide source code, I can compile the library how I want, with the settings I want, so it plays nice with my .exe.


Neither Binary nor Source is 'better'. Source is more flexible, but Binary is more convenient. Both options provide the exact same library, though - the code doesn't behave any different when ran.


If you haven't compiled any libraries from source before, it can often be a pain (unless you use Visual Studio and they are pre-setup for exactly the version of Visual Studio you are using), hence the convenient pre-built option.

#5303120 Game Levels - Easy, Normal, Hard... Or Alternative?

Posted by on 29 July 2016 - 04:35 PM

I prefer having checklists (and drag bars) of features I can turn on and off.


And maybe assign each feature a "difficulty" scoring (for a beneficial feature, it can be a negative score), and display a "Easy/Medium/Hard/Very Hard" label to the user based off of all the features he has enabled, prior to him generating the map.

[ ] Fog of war
[x] Neutral AI
[ ] Carnivorous plant life
[ ] Storms
[x] Floods
[x] Forest fires

Resource scarcity:

AI intelligence:

AI speed:

Resulting difficulty: Stupidly Hard

Ready to play? |[BEGIN GAME]|