Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug

Twiggy794 posted:

Irrlicht is another totally simple engine that's great for getting your feet wet with 3D engine programming. It's got great tutorials and a decent community.

Regarding XNA: why is it I need Visual C# Express? I have Visual Studio 2005 already, but no matter what XNA bitches at me for not having Express installed.

Xna.com just posted that the Beta for XNA 2.0 has been released and it has support for VS2005.

Adbot
ADBOT LOVES YOU

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug

The Monarch posted:

Can anyone point me to a good, recent directX tutorial/website that won't make me pay for anything? I have a copy of visual c++ and the directx sdk, but a lot of the tutorials I'm finding are pretty out of date.

Also, does anyone know of a good website based around the quake 3 source code? I'm looking through it but most of it's flying over my head, and some good explanations about what's doing what would be nice.

http://ultimategameprogramming.com/

It assumes you know nothing and works up from there.

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
I'm teaching myself HLSL and am having a real bear of a time with it. I can follow the tutorials showing how to apply a basic effect, and I can implement other peoples shader files (if they have sample code...) but I'm having trouble making the logical breakthrough to implementing more than just a basic effect. For example: I have seen samples of normal mapping and cel shading, but can't figure out how I would apply both effects given that the samples I have render in distinct ways.

XNA is the platform I am using and really all I need is a good source of reference for building increasingly complex effects, preferably starting off simple and building from there. I find the examples of XNA to be to basic, and the white pages on MSDN goes from shallow to deep with little notice. What sources would your recommend?

Also, if anyone just likes talking about this mind melting poo poo feel free to PM/IM me.

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques?

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
I'm working on a 3rd person cover system in Unity (C#) using the new Input System. I want to imitate MGS1 behavior where if the player stops pressing the stick towards cover the character exits cover. I feel like I need to turn my movement direction (represented by a Vector2 from the Input System) into a Vector3 and then modify it so its values relative to the players forward Vector but I'm not sure how. Is transforming my input to be relative to player.forward the right approach, and if so what's the basic math look like?

got it, something like this:

code:
var e = Camera.main.transform.rotation.eulerAngles;
e.Set(0f, e.y, 0f);
var m = Quaternion.Euler(e) * new Vector3(input.x, 0f, input.y);
var d = Vector3.Dot(transform.forward, m);

if (d >= 0)
    ExitCover();
edit to add: In order to ape MGS1 and repeatably take cover, it doesn't seem like Unity's collision detection is going to do the job. After leaving cover, i have to move a short distance from cover to re-trigger collision+cover. While in cover, I already use a linecast to detect the edge of cover. I'm thinking a short linecast to test for nearby cover be would let me quickly enter/exit cover. Does that seem right?

Dr. Poz fucked around with this message at 02:12 on Oct 4, 2021

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
I have the old Beginning Physics & Math for Game Programmers book but its 20+ years old now and I'm still poo poo at knowing when its time to use things like Dot/Cross product. Is there a more modern reference with less need for errata?

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
I'm trying to develop a cover mechanic mimicking MGS3. I'm using Unity (2020.3), a Cinemachine Freelook camera and the new Input System. Directional Input is captured in a Vector2 when the movement event is broadcast.

I would like when in cover and player maintains directional movement into cover:

- Camera Direction is perpendicular to cover, player is idle
- Camera Direction changes by -Y (rotating to player right), player starts moving left
- Camera Direction changes by +Y (rotating to player left), player starts moving right
- Player movement input changing to the direction of the wall after camera movement should return player to idle
- Camera Direction returning to perpendicular view angle should return player to idle

Movement should then also be influenced by directional input relative to the players facing. Relative directional input becoming parallel with cover should cause the player to exist cover.

Efforts towards a solution

My current implementation only works when the player is facing in either direction on the X axis. When in cover with a facing on the Y axis, movement (induced from either Camera or input) the player does move, but in the wrong direction.

Code:

code:
Vector2 movementInput;

private void OnMove(InputValue value)
{
	movementInput = value.Get<Vector2>();
}

private void Update()
{
	coverBehavior.HandleUpdate(movementInput);

	var input = new Vector3(movementInput.x, 0f, movementInput.y);
	if (coverBehavior.IsInCover)
	{	
		var camAngles = Camera.main.transform.rotation.eulerAngles;
		camAngles.Set(0f, camAngles.y, 0f);
		var camRotation = Quaternion.Euler(camAngles);
		input = camRotation * transform.rotation * input;
	}

	SetFloat(PlayerAnimations.MoveX, input.x);
	SetFloat(PlayerAnimations.MoveY, input.z);

	playerAnimator.SetBool(PlayerAnimations.InCover, coverBehavior.IsInCover);
}

Vector3 GetCameraForward()
{
	Vector3 forward = Camera.main.transform.forward;
	forward.y = 0f;
	return forward.normalized;
}
Dot Product

The Dot Product of Camera Direction and Player Right give potential movement in camera direction. What I'm falling short on determining is how to properly transform directional input, or if that's even the right approach. I don't think this is the right approach because movement isn't really caused by the Camera Direction in MGS3, it's caused by the effects Camera Direction has on directional input.

code:
var camFwd = GetCameraForward();
var playerRight = transform.right;
playerRight.y = 0;
var dot = Vector3.Dot(camFwd, playerRight);
var positionalInput = transform.rotation * input;
input.x = -dot;
This produces movement in the correct direction based on camera position, but I struggle to properly modify it by directional input. This is what leads me to think that my current approach may be closer if currently flawed.

Which of these approaches seems most reasonable/cheaper to perform, or are my problems rooted in the fact both approaches are wrong?

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug

Jabor posted:

Assuming you're not deliberately making a Resident Evil callback by using unplayable tank controls, you should determine your absolute input by multiplying the controller input by the camera rotation, and not caring at all about the player rotation.

It's not RE style movement, it's Metal Gear Solid style movement while in cover. The player is locked into movement along their local X axis. I figured it out eventually and the solution is to use the Dot Product of the input (multiplied by camera forward/right) and players transform.right. This gives movement along local X based on directional input and camera angle, a la Metal Gear Solid 3. There might be a shorter way to express the camera stuff, but this is the idea written minimally.

code:
var input = new Vector3();
input += directionalInput.x * GetCameraRight();
input += directionalInput.y * GetCameraForward();

var moveDot = Vector3.Dot(input, transform.right);
transform.Translate(moveDot * Time.deltaTime, 0, 0);

Dr. Poz fucked around with this message at 16:39 on Oct 6, 2021

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
if you look at the most successful open source re-implementations of magic, for example XMage or Forge, they just store card behaviors as code. you may be able to abstract your mechanics broadly enough to just store some values (ex: "Draw": 3) but once you've built up enough card implementations you'll get a sense for how to best refactor it for your uses.

my personal inclination for this type of project is to not use classes for cards if they get anywhere near the complexity of magic. for things like lands vs spells, there are plenty of effects that can turn lands (or even the top card of your library via manifest!!) into creatures or things that can change the color of your cards. i would recommend using something like a Component Entity System architecture, that way your cards just get data stored on and then your systems can handle the complexity of checking for triggers, resolving effects or progressing turns. now, take all that with a big grain of salt because if you again look at the most successful open source re-implementations of magic they pretty heavily make use of classes and just do lots of conditional checks to make sense of object state.

CitizenKeen posted:


1. I'm making an asynchronous multiplayer game (think Dominion against friends, played very asynchronously). I'm trying to be performant loading game data - it won't happen just at the start of the game (like a client based game), but I think every time a player loads up the site to see what their opponent did. Which is why I was thinking of instantiating should be done in code, not from JSON/Markup. I'm also thinking from SQL, but storing that seems a pain. I don't want to make my server read 100 JSON files every time a player loads a page.

this sounds sort of like event sourcing/state replay. you can replay the state of your application from beginning to end or from one arbitrary point to another. if you're using C#/.NET Greg Young has some sample code out there that pairs really well with marten-db for this kind of thing.

edit: you can adapt the concept to other languages but here's the sample repo i was thinking of. you compose your game state as an Aggregate Root and then any modifications to game state are logged as change operations and then a finalized object also gets stored. this is what enabled state playback. to persist that is where marten would come in.

https://github.com/gregoryyoung/m-r

Dr. Poz fucked around with this message at 20:28 on Nov 16, 2021

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
Does Unreal Engine have any kind of starter examples comparable to Unity3ds Roll-a-Ball?

Dr. Poz fucked around with this message at 23:03 on Jan 30, 2023

Adbot
ADBOT LOVES YOU

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug

Chainclaw posted:

Wtf is that link, it downloaded a shade executable

that was a incorrect paste of a work zoom link, sorry. if you could edit the quote, i'd appreciate it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply