Jump to content
Eternal Lands Official Forums
Florian

Random bag positioning

Recommended Posts

updated in CVS: less x,y offset (+-/ 0.0625 points), less tilt (-15..+15 degrees), same rotation (-180..+180 degrees)

 

this gives still some variety due to the rotation

Share this post


Link to post
Share on other sites

Eh, I'd suggest just taking it out all together. Isn't there some other important projects to work on? This was seems kind of meaningless and fairly annoying.

Share this post


Link to post
Share on other sites
updated in CVS: less x,y offset (+-/ 0.0625 points), less tilt (-15..+15 degrees), same rotation (-180..+180 degrees)

 

this gives still some variety due to the rotation

 

The lower offset does look better than the previous random bag positioning, however I still don't see any improvement over the status quo. The random bags often still look terrible in relation to characters. I tried sitting and standing on various tiles, facing various directions. Personally, I think there is too long a list of bugs and feature requests to see why the minutia of bag positioning on a given tile is getting the attention. I do appreciate the effort to make EL more aesthetically pleasing, but I don't know that random positioning can ever look universally "good" while characters can face 8 different directions on a given tile.

Share this post


Link to post
Share on other sites

This looks silly and doesn't really serve any purpose, functionally or aesthetically. I suggest removing it.

Share this post


Link to post
Share on other sites

I'm currently on holiday, so I don't have access to some development machine ...

 

Eh, I'd suggest just taking it out all together. Isn't there some other important projects to work on? This was seems kind of meaningless and fairly annoying.

 

I think it's useful. I'm a voluntary developer. I contribute stuff I think the game needs and stuff my limited programming knowledge allows me to implement. When I have an idea I look at the source code and try to find an implementation I can actually complete. Or other people, granted, mostly from the German EL community, tell me their ideas.

 

I don't have the time and/or the motivation to tackle huge projects like finishing the emotions, porting the new gfx engine to mac, and what else "needs to be done".

 

... but I don't know that random positioning can ever look universally "good" while characters can face 8 different directions on a given tile.

 

More variety for the bags doesn't solve that problem, but softens it.

People sitting "in" a bag, in other words: no collision detection for objects, is a far more basic problem in EL.

 

So, if there's consens in the community to remove bag variety, then remove it.

Share this post


Link to post
Share on other sites

Hm, well seeing that since its been committed to CVS, there has only been negative comments toward it, I think that is close enough. No one has taken the time to post that it is a great feature.

 

Don't get me wrong, I appreciate the projects you do, but this one really doesn't give a positive aspect to the game. (and obviously you think its useful since you implemented it :P)

 

And frankly, I asked another programmer to remove it, and they won't because they think it will upset you. And frankly, it would upset my eyes to make this a permanent feature.

Share this post


Link to post
Share on other sites

Could you post some screenshots of bag positions where it looks weird?

On my test system the variations are very subtle, only really noticeable when I drop lots of bags in one area.

But since this is only tested on my mac, maybe on other systems something bad happens.

Share this post


Link to post
Share on other sites
Could you post some screenshots of bag positions where it looks weird?

On my test system the variations are very subtle, only really noticeable when I drop lots of bags in one area.

But since this is only tested on my mac, maybe on other systems something bad ™ happens.

If you have a pile of bags on their own, off in the distance, not relative to any character, then maybe they look fine. My issues posted about earlier all relate to relative locations. Drop down a bag at your feet, and turn around in a circle (8 positions) with insert or delete. Then try the same thing, sitting after each rotation. During first round of tests, I was sitting at a storage with most of the bag behind me. Facing a different direction, that same bag was oddly sticking out of my foot or side (standing vs. sitting). This looks far worse than the original placement, imo.

 

I would venture to guess that most bags which pop up are directly underneath a player (or will be a second after a player kills a creature). This is the situation where "randomly" positioned bags look their worst. I think it is not worthwhile to implement a feature which can make a big, far off pile of bags look better -- at the expense of a more common "under foot" situation.

 

Given that this is the suggestions forum, I would suggest: reverting back to the original bag location code, and brainstorming for ideas which can fix the effect of the bags looking so mechanically placed.

 

Is it possible to have a bag pushed off center to always be in front of where the character is facing? e.g. if I face North and drop a bag, that bag would be biased to the North of the tile. If I pick up that bag and spin to head East, a bag dropped on this same tile would be biased East.

 

One other possible idea (not sure if it would look terrible, or be too tough to implement): is it possible to have randomly displayed skins (maybe 4 slightly different bag styles) randomly chosen when a bag is created?

Share this post


Link to post
Share on other sites
Is it possible to have a bag pushed off center to always be in front of where the character is facing? e.g. if I face North and drop a bag, that bag would be biased to the North of the tile. If I pick up that bag and spin to head East, a bag dropped on this same tile would be biased East.

 

Hmm, there is no direct connection from actor to bag, especially if the actor gets removed before the bag drops. (Maybe a "removed actor cache" would help ...).

 

One other possible idea (not sure if it would look terrible, or be too tough to implement): is it possible to have randomly displayed skins (maybe 4 slightly different bag styles) randomly chosen when a bag is created?

 

I could easily change the color of the bag texture slightly, I'll try that idea when I get home.

 

What about the bag rotation? Should that stay in the code when x,y offset and tilt are removed?

Share this post


Link to post
Share on other sites

The bag rotation is fine I think, just the awkward placing on a tile needs taken out.

Share this post


Link to post
Share on other sites
Could you post some screenshots of bag positions where it looks weird?

On my test system the variations are very subtle, only really noticeable when I drop lots of bags in one area.

But since this is only tested on my mac, maybe on other systems something bad ™ happens.

 

bag.png

 

Three seperate bags. I've had more extreme examples, but I think these look funny enough.

Share this post


Link to post
Share on other sites
Can you just make random rotation on the Z axis? That alone would look good I think :P

Yes I can. That's already in the code. It's modular: all four influences on the bag are in separate functions.

Share this post


Link to post
Share on other sites

Patch to remove x,y offset

 

### Eclipse Workspace Patch 1.0
#P elc
Index: bags.c
===================================================================
RCS file: /cvsroot/elc/elc/bags.c,v
retrieving revision 1.63
diff -u -r1.63 bags.c
--- bags.c	4 Mar 2009 07:05:41 -0000	1.63
+++ bags.c	12 Mar 2009 17:53:46 -0000
@@ -44,8 +44,8 @@

// forward declarations
void draw_pick_up_menu();
-float get_bag_offset_x(float pos_x, float pos_y, int bag_id, int map_x, int map_y);
-float get_bag_offset_y(float pos_x, float pos_y, int bag_id, int map_x, int map_y);
+// float get_bag_offset_x(float pos_x, float pos_y, int bag_id, int map_x, int map_y);
+// float get_bag_offset_y(float pos_x, float pos_y, int bag_id, int map_x, int map_y);
float get_bag_rotation(float pos_x, float pos_y, int bag_id, int map_x, int map_y);
float get_bag_tilt(float pos_x, float pos_y, int bag_id, int map_x, int map_y);

@@ -60,7 +60,7 @@
	*out=0;
}

-float get_bag_offset_x(float pos_x, float pos_y, int bag_id, int map_x, int map_y)
+/*float get_bag_offset_x(float pos_x, float pos_y, int bag_id, int map_x, int map_y)
{
	char str[64];
	MD5 md5;
@@ -78,9 +78,9 @@
	return (sinf(powf(digest[0], 2.0f)) + sinf(powf(digest[1], 2.0f)) + sinf(
		sqrtf(abs((float) digest[2]))) + cosf((float) digest[3]) + sinf(
		(float) digest[4])) / 80.0f * ((((int) abs(digest[5])) % 3 == 0) ? 1.0f : -1.0f);
-}
+}*/

-float get_bag_offset_y(float pos_x, float pos_y, int bag_id, int map_x, int map_y)
+/*float get_bag_offset_y(float pos_x, float pos_y, int bag_id, int map_x, int map_y)
{
	char str[64];
	MD5 md5;
@@ -98,7 +98,7 @@
	return (cosf(powf(digest[1], 2.0f)) + cosf(powf(digest[2], 2.0f)) + cosf(
		sqrtf(abs((float) digest[3]))) + sinf((float) digest[4]) + cosf(
		(float) digest[5])) / 80.0f * ((((int) abs(digest[6])) % 3 == 0) ? 1.0f : -1.0f);
-}
+}*/

float get_bag_rotation(float pos_x, float pos_y, int bag_id, int map_x, int map_y)
{
@@ -156,8 +156,8 @@
	x=(float)bag_x/2;
	y=(float)bag_y/2;
	//center the object (slightly randomized)
-	x = x + 0.25f + get_bag_offset_x(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
-	y = y + 0.25f + get_bag_offset_y(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
+	x = x + 0.25f; // + get_bag_offset_x(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
+	y = y + 0.25f; // + get_bag_offset_y(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);

	// DEBUG
	// printf("bag <%i> (%f,%f) rot %f tilt %f\n", bag_id, x, y,
@@ -228,8 +228,8 @@
		x=(float)bag_x/2;
		y=(float)bag_y/2;
		//center the object (slightly randomized)
-		x = x + 0.25f + get_bag_offset_x(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
-		y = y + 0.25f + get_bag_offset_y(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
+		x = x + 0.25f; // + get_bag_offset_x(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);
+		y = y + 0.25f; // + get_bag_offset_y(bag_x, bag_y, bag_id, tile_map_size_x, tile_map_size_y);

		// DEBUG
		// printf("bag <%i> (%f,%f) rot %f tilt %f\n", bag_id, x, y,

 

Please test it, I can't :P

Share this post


Link to post
Share on other sites

What am I doing wrong?

   patch -p0 < ./randombagspatch
  patching file bags.c
  patch: **** malformed patch at line 12: // forward declarations

Not sure how tough it is to change, but updating cvs is easier for me than patching files like this.

Share this post


Link to post
Share on other sites
What am I doing wrong?

   patch -p0 < ./randombagspatch
  patching file bags.c
  patch: **** malformed patch at line 12: // forward declarations

Not sure how tough it is to change, but updating cvs is easier for me than patching files like this.

The patch is created with eclipse, maybe the format for the patch command line utility differs ...

Actually I don't want to commit untested code into CVS :) I don't know if it compiles.

Share this post


Link to post
Share on other sites
What am I doing wrong?

   patch -p0 < ./randombagspatch
  patching file bags.c
  patch: **** malformed patch at line 12: // forward declarations

Not sure how tough it is to change, but updating cvs is easier for me than patching files like this.

The patch is created with eclipse, maybe the format for the patch command line utility differs ...

Actually I don't want to commit untested code into CVS :) I don't know if it compiles.

The patch does compile and run OK (very quick test) and looks better to me.

To create the a patch file from a forum posting I usually find clicking on quote&reply then selecting the text between the


tags works best. I have had issues with just selecting the neatly rendered text in the past.

 

edit: In fact I get the same error as you asgnny, if I just select the patch text from the straight from the web page. It's because the white space gets messed up.

Edited by bluap

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×