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
superh
Oct 10, 2007

Touching every treasure

Lucid Dream posted:

I worded it weird - I'm trying to do parallax clouds, and I want the clouds to fade into the background as they get further away, but (ideally) I don't want them to show through each other when they overlap.

Is there a chance you're overthinking it? You're not really trying to get them to fade away further back, you're trying to tint them to a blue (or a specific color out of a gradient) - just keep the cloud part of the asset opaque, draw them back to front, and use progressively less tint as you get towards the front?

Adbot
ADBOT LOVES YOU

superh
Oct 10, 2007

Touching every treasure

RoboCicero posted:

What's the best way to develop for an iPhone on a windows machine? I know that eventually I need a Mac to publish it to the device, but I'd like to put that step off until I actually have to deal with it.

I'm also looking at some networking (like Hero Academy-esque PvP) and I'm not sure if some of the middleware libraries handle that well / at all. Does anyone have any suggestions?

I know I asked last time but I don't think I got any responses :shobon:

Other than using unity as your framework and never getting to test in any real way until you get a Mac... No way. Get a cheap (ish) Mac mini and start right. Save 100 bucks by not buying the dev license until you're ready to test on a real device.

superh
Oct 10, 2007

Touching every treasure

TJChap2840 posted:

I've said this multiple times in this thread, but it doesn't seem to stick.

I have a friend who develops for iPhone using Cocos2d-X. He doesn't own a Mac.

An honest question about this - how does he test (on a simulator or device) or publish a binary to the app store?

superh
Oct 10, 2007

Touching every treasure

Bocom posted:

This, essentially.

Walk into NPC -> Collision resolution -> If you're colliding at an angle near a wall, you're pushed into it.

First of all, as someone else mentioned, don't "push", zero velocity so they can't make the illegal move in the first place. Switching from XNA won't help with this issue either, it's a valid, difficult, issue. It'll be taken care of for you if you use someone's framework but if you want to produce "your own" game - its not impossible to figure out.

I'd recommend a series of bounding points, for world collision. Using radiuses will not allow you to move smoothly along a wall, you'll get tucked into corners between tiles. Use a series of points to test collision and do not use corners (since this will lead to sticking problems). Ive used two points per edge, offset inward by a few pixels, tested directionally in the past.

superh
Oct 10, 2007

Touching every treasure

Orzo posted:

These solutions don't work unless you're processing movement pixel by pixel--otherwise your game will feel blocky and clumsy, because you'll be in a situation where let's say you want to move a character 5 pixels to the right and you can't because there's a collision 3 pixels away. The correct behavior is to move the object 3 pixels according to the collision resolution, instead of just stopping the object.

That is quite correct! Especially with time based movement instead of pixel based movement, different dts would have you bouncing around if movement just stopped. Moving the correct amount to the collision point is the right way to go.

superh
Oct 10, 2007

Touching every treasure

Physical posted:

I'm in C# in a unity function doing the following:
Input.GetKeyDown(KeyCode.LeftShift)

The debugger reports an error: "Unknown member: KeyCode"

Why is unity not aware of it's own documented enum?

I think Input.GetKeyDown takes a Key not a KeyCode, as in -

Input.GetKeyDown(Key.LeftShift) wrong info! This is what I get for posting away from my computer :)

superh fucked around with this message at 16:13 on Feb 8, 2013

superh
Oct 10, 2007

Touching every treasure

KoRMaK posted:

After I got my AI up I kept wondering "how the hell do I make this more entertaining" because basically the AI gets up next to you and mashes its attack.

You make the AI hold off and not attack all the time. Make it run away for a bit and do stupid things too. This is the hardest part, it's easy to make an unbeatable unfun AI but it's better to make one that's more complicated and more "realistic."

In Street Fighter if you get hit you're interrupted and "stunned" in a hit state very briefly, a tiny fraction of a second, but if you get hit enough times you enter a real "stun" state. I think whether or not this feels "bad" in the game comes down to how long you stay in this state.

superh
Oct 10, 2007

Touching every treasure

MrSamurai posted:

Make sure that your prefab field is public. Also worth trying to run your project and see if it gets updated in unity (I've noticed the inspector is slow to update code changes sometimes)

Or, if you haven't finished debugging all classes (even ones you're not worried about at the moment) to remove all errors, the inspector will never update.

superh
Oct 10, 2007

Touching every treasure

Suran37 posted:

Ok, so first of all I might be going about this wrong, but I am trying to make a Beat 'em Up type game in Unity with 2D Toolkit.
Anyway, I did some googling and saw a method where you put the camera at a 30 degree angle and then put your sprites at a 30 degree angle.
Like this:


For some reason the floor renders over the player though.
Like this:


Again I might be going at this all wrong, but I have no idea why it is doing this.
I keep having problems in Unity, I might just switch to Game Maker and try it out.

You're doing it right, but it's a problem with zsorting large planes in perspective projection. I ran into the same thing recently, I solved it by manually setting the render order on sprites, which was a pain, and fairly limiting, but worked ok.

I'm on my phone so I don't have the exact information at my fingertips but it involved setting the render queue on each individual material.

This is a non issue with orthographic perspective, but you'll miss out on some cool perspective effects.

superh
Oct 10, 2007

Touching every treasure
Does *something* display, just in the wrong spot, or does nothing display at all?

If it's the former, the math finding the screen point is probably wrong. If it's the latter, you might have the math right but you're not creating the element correctly.

Can you make damage numbers pop up at a fixed point in the GUI successfully, independent of where they're "supposed" to spawn?

superh
Oct 10, 2007

Touching every treasure

Orzo posted:

Actually Futile seems pretty decent for Google searches, since it's not a common word.

I just can't imagine the thought process that went into choosing a word that evokes feelings of hopelessness and...well, futility.

Having worked in 2d Unity it gives me the impression that the author of Futile knew precisely what he was doing when he chose that name.

superh
Oct 10, 2007

Touching every treasure

Tendales posted:

The end result is what matters, really. Flash has limitations, but if your project doesn't push against those limitations, it's not that big a deal. Binding of Isaac, for example, is the poster child of trying to make ActionScript 2 do way too much.

On the plus side, if you start making a project in AS3, and it turns out you don't want to do Flash anymore, migrating your code to Haxe is fairly straightforward, as these things go.

Binding of Isaac is AS2? I'm simultaneously impressed and completely taken aback...

superh
Oct 10, 2007

Touching every treasure

poemdexter posted:

Can someone tell me what's going on here? http://poemdexter.com/unity-player/xelda-web.html

All of the textures are super blurry and no amount of settings tweaking in Unity will let me build to web where it doesn't look like poo poo.





It looks like you're doing pixel art, so you need to change your texture import settings from bilinear filtering to point (no) filtering.

superh
Oct 10, 2007

Touching every treasure

Baldbeard posted:

Camera woes

seiken posted:

I don't get it. Isn't this exactly what you wanted to happen?

Regardless of that, moving the level as a proxy for a camera is kind of confusing. If possible I'd advise storing a separate camera position and when you draw the level, offset everything by the negative of the camera position. Then it's pretty trivial to do boundaries, just set the camera position to min(boundary_max, max(boundary_min, player_position)) every frame.

Yeah do this, exactly. Make a camera variable (just a point) and render the whole level off it. Set it to the player position, but clamp it to half the screen width of the outer boundary.



Coldrice posted:

Whew! I spent the week with c# / unity / futile. I spent the last 2 days working on making tile maps work in futile. I feel really pleased! The results aren't great, but it's results! Really I'm shocked by how much quicker I'm picking up c# then I did obj-c.

;

There are gaps in my tiles for some reason which I'll figure out later, but they show up! I actually ended up writing a c# program to parse data and output the information necessary for futile to accept my simple spritesheet for tiles, so I'm hoping it'll allow me to avoid buying texturePacker. I even made a video of my little application :) http://youtu.be/_CpjS0_k1u8

I think you're having the same problem someone else had just a little bit earlier in the thread - make sure your textures are set to point filtering for pixel art instead of bilinear. It's bleeding. Looks awesome though!


I've been playing with futile over the long weekend too, porting an olllllld project from XNA. I'm coming from a flash / haxe background so a lot of the guts of OpenGL and 3d are a mystery to me, but I was wondering if anyone had any suggestion for per-pixel tinting of an image. I was jury rigging something horrific in XNA (each player character pixel was a separate tinted draw...) and I'd like to do something less terrible in unity.

Am I looking at shaders? Or is there an easy way to do some dynamic masking in unity?

superh
Oct 10, 2007

Touching every treasure

Baldbeard posted:

Yeah I had the character within the level, so both were being moved after the player moved independently, causing the player to move twice so to speak. I figured out a a formula that shows the loss caused by this, based on any level/character position, so I have it auto correcting itself.

Haha definitely jerry rigged, but I'm almost proud. I'll try the camera point variable suggestions for sure if this causes any more problems.

Im on actionscropt3 btw. So if I add the level to the stage based off of the camera/character position - won't i still have to move the level around to center the moving character in the viewable area?

I guess I don't quite understand the concept. How do I move the actual viewable canvas or stage or whatever? I assumed you had to move the objects in and out of a stationary stage view for a "camera effect".

This means that you will have to 2 stage your rendering process in AS3. Instead of setting thing's x and y and trusting that, you only use that as it's screen space position, and you give each object a world space position variable. Then, you run a render(camera) function on each of your objects which sets their screen space position ( spite x and y ) to the world space position minus the camera position.

Then you can just move the camera and pan around, set it to the player's position or something else, it won't matter. Easy! Freedom! You'll love it! :D

superh
Oct 10, 2007

Touching every treasure

Baldbeard posted:

Yeah, that definitely sounds boss. I think I understand the basic concept now, but I'm not sure how I would go about actually implementing it. World space vs screen space + the camera position is a little much for my feeble brain right now. I would probably need to see an actual example to fill in the blanks. All in due time I guess. I really appreciate you guys taking the time to explain this stuff to me. And sorry for noobing up the thread.

No problem! The camera is definitely a weird thing to wrap your head around, at first. Pseudo-code, incoming!

So right now you're probably moving things around by stuff like:

_player.x += 10;
_player.y -= 10;

What you're really doing here is controlling both their screen position and their world position, which is not going to be accurate when you get beyond a single screen's worth of content (as I'm sure you're noticing, when you have to offset all the world positions as you move.)

What you should do, in each of your world elements, or a base class for all the things in your world, is separate the two concepts into screen position (the x and the y on the object, basically what Flash is using to render the object) and the world position - it's position in the game world relative to all the other objects.

So everything gets a Point - for this demonstration I'll call it "worldPos" to keep this information. You will use this Point instead of x and y for almost all the things you're using x and y for now.

Now you need another Point to act as the "camera", which you can use to do some math to figure out the screen position of the objects from their world position.

So to get the two to interact, put a function called something like "render" on the base class of all the objects in the world.

code:
public function render( camera:Point ) : void {
	this.x = worldPos.x - camera.x;
	this.y = worldPos.y - camera.y;
}
That will render the objects in the world around your camera! However there is one more thing you'll probably want, to make it a little more usable, since that formula actually bases your camera around 0,0, or the top left corner of the screen, which is not very intuitive. We need to add an offset to the camera. So when you first set it's position, put it at the middle of the screen - camera = new Point(stageWidth/2,stageHeight/2) - and then add that amount to the formula above in the render. (I just store them as static variables in another class so anything that needs them can access them from anywhere.)

That looks like this :
code:
public function render( camera:Point ) : void {
	this.x = worldPos.x - camera.x + stageWidth/2; 
	this.y = worldPos.y - camera.y + stageHeight/2;
	//Replace stageWidth/2 and stageHeight/2 with a static variable somewhere else to keep everything the same if your screen size changes
}
To pan around, simply change the camera Point's x and y! Do something like this, as you move your player around by changing it's worldPos:

code:
// Move the player however you want
if ( player_move_right ) {
	player.worldPos.x += 10;
}

// Snip

// Focus the camera on the player
camera.x = player.x;
camera.y = player.y;

// Cap the camera to it's bounds
if ( camera.x > cameraRightEdge ) {
	camera.x = cameraRightEdge;
}
// And all the other directions, of course!

// Now that the camera is set, you can safely "render" the world off it!
for ( int tI = 0; tI<_worldObjects.length; tI++ ) {
	_worldObjects[tI].render(camera);
}
Ta da! Now everything's rendering off the camera, which is centered on your screen. You can even pan over to another object by setting the camera's x and y to some other location independent of the player.

So that's a lot of stuff! But even if you don't fully understand it, try implementing that and playing around with it to see what you get. The net result will be the same and once you have it in place, it will be easier to conceptualize spatial movements and relationships, when the world stays constant and the player is moving within it.

Hope some of that helps!

superh fucked around with this message at 01:56 on May 29, 2013

superh
Oct 10, 2007

Touching every treasure

Orzo posted:

I should probably refactor this:
code:
Dictionary<LayerType, Dictionary<int, Dictionary<Matrix4, Dictionary<BlendingMode, Dictionary<Texture, List<RenderItem>>>>>>
:)

Just wait until you have to port it to Haxe and you're only supposed to use strings as Dictionary keys... :suicide:

e: vvvv that is awesome.

superh fucked around with this message at 02:24 on May 29, 2013

superh
Oct 10, 2007

Touching every treasure

devilmouse posted:

Haxe 3's Maps support "most" objects as keys! :eng101:

(The haxe 3 final just came out last week and it is pretty great. We've been using it since the betas back in the fall and I have mostly nothing but praise. Mostly.)

Haxe 3 posted:

As a bonus, maps allow element access with the Array operator:

var map = new Map();
map["foo"] = 9;
trace(map["foo"]); // 9
map["foo"] += 12;
trace(map["foo"]); // 21

Woo hoo! Yeah this looks awesome, once our libraries are up to date we'll be switching for sure! Although I'm not sold on -

"Haxe 3 posted:

// haxe 2
var property(getProperty, setProperty):Int;
function getProperty() return 1
function setProperty(i) return 1

// haxe 3
var property(get, set):Int;
function get_property() return 1;
function set_property(i) return 2;

I kinda like being able to name my getters and setters (not that I ever use anything but _getVariable and _setVariable anyway). If they're going to still use the variable(get,set) syntax why do we still have to define strict names? I like C#'s { get {} set {} }.

superh
Oct 10, 2007

Touching every treasure

KoRMaK posted:

Is that also a reason in the pro column to use sprite sheets instead of animated gifs? I've never scene an efficiency reason or otherwise for why to use one over the other. I prefer gifs.

Besides the benefit that spritesheets will give you batching in engines that draw 2d sprites as polygons, with gifs you are going to be limiting yourself to a 256 color palette per animation and the accompanying dithering associated with turning an image into that palette.

Besides that, not many frameworks will let you load up a gif and play it within the context of a game, that I know of? Are you using the gif timing for the animation timing, or timing it out yourself?

I actually can't think of any benefit to using animated gifs. There are many utilities out there that will take a series of images done in photoshop and pack them into an easily parseable atlas for your platform of choice - like http://www.codeandweb.com/texturepacker

superh
Oct 10, 2007

Touching every treasure

A Bloody Crowbar posted:

This is AS3/Flixel.

I'm assuming data is being returned before the completion handler does its work.
It may just be because it's almost 4am but I'm lost as to how I can wait until that handler finishes before returning anything in the outer method...

Yeah, you're returning the null data object instantly because the load hasn't completed by the time the function ends. The onLoad event hasn't fired yet. Flash isn't threaded so you can't like, force a wait in that function until it's done or the whole program will halt waiting for the load. Do this instead:

code:
public class PlayState extends FlxState
{	
	private var _level:FlxTilemap;
	public var data : Array;
	public var loadComplete : Bool;
		
	override public function create():void {
		FlxG.mouse.show();
		_level.loadMap(FlxTilemap.arrayToCSV(getData(), 20), FlxTilemap.ImgAuto, 0, 0, FlxTilemap.AUTO);
		add(_level);
	}
		
	private function getData():void {
		data = new Array();
		loadComplete = false;
		var loader:URLLoader = new URLLoader();
		loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
		function onProgress(e:ProgressEvent):void {
			FlxG.log("LOADED:"+e.bytesLoaded+"/"+e.bytesTotal);
		}
		loader.addEventListener(Event.COMPLETE, onLoad);
		function onLoad(e:Event):void {
			//FlxG.log("SUCCESS:"+e.target.data);
			data = e.target.data.split();
			loadComplete = true; // Set this to true when it's done, it will be at an unknown time
			FlxG.log(data);
		}
		loader.load(new URLRequest("../data/default.txt"));
		// Don't return the data here!
	}
}
So then, wherever you call doLoad() from, loop and do something else but check whether or not the loadComplete is done and it's safe to use the data variable.

superh
Oct 10, 2007

Touching every treasure

DarthJeebus posted:

Can any resident XNA gurus tell me how I should be rendering my sprites so that they aren't incredibly blurry when I'm moving them around? I Googled around to no avail.

edit: vvv I forgot to mention that I tried that unsuccessfully, unless I hosed it up somehow. I'll try it again.

Are they just plopped on stage or are you rendering them off a camera? If its a camera you need to clamp that too.

superh
Oct 10, 2007

Touching every treasure
I wrote this up for another poster a few pages back. It's for as3, and I have no experience with Pygame, but the concepts are all outlined here.

superh posted:

No problem! The camera is definitely a weird thing to wrap your head around, at first. Pseudo-code, incoming!

So right now you're probably moving things around by stuff like:

_player.x += 10;
_player.y -= 10;

What you're really doing here is controlling both their screen position and their world position, which is not going to be accurate when you get beyond a single screen's worth of content (as I'm sure you're noticing, when you have to offset all the world positions as you move.)

What you should do, in each of your world elements, or a base class for all the things in your world, is separate the two concepts into screen position (the x and the y on the object, basically what Flash is using to render the object) and the world position - it's position in the game world relative to all the other objects.

So everything gets a Point - for this demonstration I'll call it "worldPos" to keep this information. You will use this Point instead of x and y for almost all the things you're using x and y for now.

Now you need another Point to act as the "camera", which you can use to do some math to figure out the screen position of the objects from their world position.

So to get the two to interact, put a function called something like "render" on the base class of all the objects in the world.

code:
public function render( camera:Point ) : void {
	this.x = worldPos.x - camera.x;
	this.y = worldPos.y - camera.y;
}

That will render the objects in the world around your camera! However there is one more thing you'll probably want, to make it a little more usable, since that formula actually bases your camera around 0,0, or the top left corner of the screen, which is not very intuitive. We need to add an offset to the camera. So when you first set it's position, put it at the middle of the screen - camera = new Point(stageWidth/2,stageHeight/2) - and then add that amount to the formula above in the render. (I just store them as static variables in another class so anything that needs them can access them from anywhere.)

That looks like this :
code:
public function render( camera:Point ) : void {
	this.x = worldPos.x - camera.x + stageWidth/2; 
	this.y = worldPos.y - camera.y + stageHeight/2;
	//Replace stageWidth/2 and stageHeight/2 with a static variable somewhere else to keep everything the same if your screen size changes
}

To pan around, simply change the camera Point's x and y! Do something like this, as you move your player around by changing it's worldPos:

code:

// Move the player however you want
if ( player_move_right ) {
	player.worldPos.x += 10;
}

// Snip

// Focus the camera on the player
camera.x = player.x;
camera.y = player.y;

// Cap the camera to it's bounds
if ( camera.x > cameraRightEdge ) {
	camera.x = cameraRightEdge;
}
// And all the other directions, of course!

// Now that the camera is set, you can safely "render" the world off it!
for ( int tI = 0; tI<_worldObjects.length; tI++ ) {
	_worldObjects[tI].render(camera);
}

Ta da! Now everything's rendering off the camera, which is centered on your screen. You can even pan over to another object by setting the camera's x and y to some other location independent of the player.

So that's a lot of stuff! But even if you don't fully understand it, try implementing that and playing around with it to see what you get. The net result will be the same and once you have it in place, it will be easier to conceptualize spatial movements and relationships, when the world stays constant and the player is moving within it.

Hope some of that helps!

superh
Oct 10, 2007

Touching every treasure

Lazerbeam posted:

I am successful! A second thanks to you superh, getting my sprite's screen position right was the key :)

Awesome! Glad to hear it! :) It's not too bad once you see what you need to do.

superh
Oct 10, 2007

Touching every treasure

the posted:

Alright, I did it, however it's not behaving exactly as I want. I have:

JavaScript code:
function OnCollisionEnter (col : Collision)
{
    if(col.gameObject.name == "sphereRed")
    {
        Destroy(col.gameObject);
		transform.localScale += Vector3(1.1,1.1,1.1);
    }
}
However, what that's doing is increasing it by 1.1 of it's current size every time it hits a red sphere, when I really want it to just increase by 1.1 of it's original size. How do I do that? Is there some way I can read the values of it's original size and store them into a var that I call back later?

Shouldn't it be -

JavaScript code:
function OnCollisionEnter (col : Collision)
{
    if(col.gameObject.name == "sphereRed")
    {
        Destroy(col.gameObject);
		transform.localScale += Vector3(.1,.1,.1);
    }
}
So it's growing by 1/10th of the original scale (1) each time, instead of adding 1 and 1/10th of it's scale every time?

superh
Oct 10, 2007

Touching every treasure

the posted:

I would think that would shrink it? Let me try and I'll get back to you.

edit: Yep, shrinked it to 10% of it's size.

I think I need to do what Orzo said, which is store the original size somehow and say "if on collision, increase by original size + 1" except, I don't know how to do that.

Is it still set to "=" from before? Setting it = .1 would shrink it but setting it += .1 will add .1 to whatever's in there.


Keeping a reference to it's original size (new Vector(1,1,1)) then setting it to origin+new Vector(.1,.1,.1) will just grow it once too.

You could break it down to this though -

code:

	origin = new Vector(1,1,1);
	change = new Vector(0,0,0);

	// On collision
	change += new Vector(.1,.1,.1);
	transform.localScale = origin + change;
But that is pretty much the same as what I wrote before, just implemented a different way.

vvv Great! No problem! :D

superh fucked around with this message at 20:15 on Jun 14, 2013

superh
Oct 10, 2007

Touching every treasure

Coldrice posted:

Quick Unity/Futile question

I'm noticing strange distortion/warbling on some of my textures. I'm using texturepacker to put it together, and everything else that uses texture packer in the game works fine. Just the UI elements. The actual UI image itself that texturepacker output is fine. Is there something going on within unity causing this?

screenshot:



That looks super weird, other than some weird texture creation issue the only thing I can think of is to make sure the position of those elements is a whole number, maybe it's freaking out trying t sub-pixel render those sprites?

superh
Oct 10, 2007

Touching every treasure

DancingPenguin posted:

Sorry for the double post.
Spent all of my day on getting the map-editor up and running. Also physics. drat I hate it.
Got a question for you fine folks, in regular top-down games, where are physics ever used except for collision with water and such objects?
Collision with tiles is something I can solve by iteration, but giving the player physics feels kind of stupid, since so far it seems that this means I have to apply a force to the player for movement (which makes them slide in a very disturbing manner).

In 90% of the games I have ever made, physics actually overkill. In a 2d tile based game some trig will be all you ever need.

superh
Oct 10, 2007

Touching every treasure

DarthJeebus posted:

Well this is annoying. My monogame project in VS2010 suddenly won't debug. I press F5/click the debug button, and it just grays out briefly before returning to normal. Other projects still debug just fine. I made sure the program wasn't still running in the background and tried a reboot, but nothing seems to work.

I'm not super familiar with VS 2010 or monogame but are there any errors that are preventing the game from compiling? Or any messages spit out into a build log?

superh
Oct 10, 2007

Touching every treasure

Lucid Dream posted:

I made a ContentHandler class with static methods like LoadTexture.

This is my preferred way of handling Asset management too. If everything needs its, either have an instance of it in a base class and remember / go through the tedium of passing it in to every constructor, or just throw it in a singleton that you can touch from everywhere. It's much better for your piece of mind.

superh
Oct 10, 2007

Touching every treasure

roomforthetuna posted:

Aha, that is a good reason. I generally prefer tweaking values in the code, but being able to assign prefabs is certainly an advantage if that's something you want to do with a global var.

I used to be of the same mindset, but there are certain areas that seeing your changes live will save you so, so much time on. Unity makes it so easy, once you can wrap your mind around it you'll really thank yourself for taking advantage of it.

For example, I was working on a unity fighting game - after switching to inspector based hit box timing / positioning I could implement a character in a single day of fiddling instead of two or three days of fine tuning and trial and error.

I've even been taking the time to implement quasi wysiwyg editors into most of my non unity products these days - it's a huge initial investment but you'll end up saving so much time in the end.

superh
Oct 10, 2007

Touching every treasure

Suspicious Dish posted:

I'm surprised you're caught up about JavaScript. HTML5 is nowhere near ready for realtime gaming, but that's mostly because of multimedia and speed issues.

JavaScript really isn't as bad as everybody makes it out to be, especially with strict mode, and it will really be the least of your worries.

This is not remotely true. My company has been working in html5 for almost 2 years now and it's been ready for prime time for about a year.

If you want to see it in action and you have an iOS device, look at the games on the nick app, https://itunes.apple.com/us/app/nick/id596133590?mt=8
They are all running html5 games in a web view.

Don't let nme/openfl taint your perception of the state if html5 gaming.

E: here's another link, that will run in your browser. It may default to flash on a desktop device, so check it out on a tablet. http://www.nick.com/games/legend-of-korra-republic-city-run.html?apiKey=001

superh fucked around with this message at 07:50 on Sep 28, 2013

superh
Oct 10, 2007

Touching every treasure

Suspicious Dish posted:

The big issue I ran into was sound and multimedia support. The state of <video> doesn't seem to be getting better, and it doesn't allow for any sort of integration on iOS -- I can't use <video> as the background to an app there.

When I used <audio>, it seemed to lag behind like it was refetching the sound from HTTP every single time I tried to play it. I've also been trying to use the new Web Audio API stuff, but it seems to again have issues with latency and accurate timing.

Yeah - there are certainly multimedia issues. I believe you're right, audio is not pre-cached, or even cached. Many devices only have a single channel limit on <audio>.

Web Audio is better - even if it has issues with accurate timing, you can pre load it properly. I was able to get lip-sync out if it for one game by tying an animations progress to the progress of a sample so it is doable.

Video is a total nightmare, and on iPhone can only run in full screen. I personally would try to do anything but use video as a background, but I'm sure there are use cases where it would be necessary.

superh
Oct 10, 2007

Touching every treasure

poemdexter posted:

2D Toolkit is half off today on the Unity asset store. I know 4.3 is going to add a ton of 2D features, but until that's released and polished a bit, this is the best 2D solution so far that I've used.

https://www.assetstore.unity3d.com/#/content/908

I can vouch for 2D Toolkit too, it's got some real slick dicing / texture packing features that work well. The workflow is a bit rough when you're used to something like Flash but it's the best that's out there now.

e: I'm using it at this very moment too! In a legacy publish-to-Flash project. :smith:

superh
Oct 10, 2007

Touching every treasure
Here's a dumb Unity question -

I set up a bunch of variables I can edit at runtime on a prefab, which I adjust as needed then hand copy back into my code.

How come some of my prefabs automatically pick up the changes to the source while others never do? Some instances make me remove and re-add the source script component before they update.

I made both of these prefabs using the same steps today, I didn't do anything different that I know of, and I've seen this before but never figured out a solution. Is the answer "because Unity" or "because you need to set x"?


e: Is it because I was accidentally setting custom values on the original prefab in the library (instead of my instanced copy), and this overrides source changes? nooope

Maybe it's the reverse? Maybe it only "keeps" when I accidentally do my editing on the original prefab in the library?

superh fucked around with this message at 18:54 on Oct 17, 2013

superh
Oct 10, 2007

Touching every treasure
Makes sense (in as much as "never trust it" can make sense!) and it's all good for me - my prefabs are instanced at runtime from the library so as long as the original is right the instances should be.

The game I'm working on is a fighting game so I notice pretty quickly if all my attack timings are off when I rebuild.

Thanks a lot!

superh
Oct 10, 2007

Touching every treasure
I never used tiling in 2d Toolkit so I don't know how much control you get, but you might have to overlap the tiles ever so slightly. You also want to set Pad Method to Extend in the Collection Editor.

vvv Great! Glad it worked!

superh fucked around with this message at 17:11 on Oct 31, 2013

superh
Oct 10, 2007

Touching every treasure
I've been "jamming" on a game for a few days now and I'm excited to show off a teaser shot



Motherlode has a ways to go but it's starting to shape up and I'm in the middle of a proud parent moment :allears:

superh
Oct 10, 2007

Touching every treasure
I believe that since it's only sold through the Unity Asset Store it's covered under the Unity Asset Store license which is pretty much "one license per seat"? Have you looked at it in the store?

superh
Oct 10, 2007

Touching every treasure
You just get 2dToolkit as source files you add to your project, so yeah. I guess it never even occurred to me that modifying it for use in my own project could be against the rules.

Adbot
ADBOT LOVES YOU

superh
Oct 10, 2007

Touching every treasure
Yeah, that looks awesome! Gonna send that around work and see what people think.

I imagine if you're doing keyframe animation you'll have to do 3-6x the number of drawings, but if you can reuse the assets in many more situations throughout the game, it will probably pay off.

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