I'm sure you've already thought of this but...
When calculating sizes are you using fractions?
If so, have you tried rounding each item down to the nearest kilobyte? I've run into an issue in the past in calculating fractal averages with fractions all rounding up to the nearest whole number. This can add up after a few calculations and cause a mess. I'm guessing this is not likely the issue you are having but it may be worth eliminating as a possible cause. Or just be sure your calculations are defined as real numbers versus integers or whole numbers, Then round off your final total.
About the weight of objects
Moderator: English Moderator
Re: About the weight of objects
CPU: Intel I7-4770 64Bit @ 3.4Ghz.
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
-
- Posts: 174
- Joined: 30 May 2013, 09:40
Re: About the weight of objects
I hadn't thought about it
and you're right, that can be part of explanation
I had some error like : 0.1 + 0.2 = 0.2999999999
then I read on w3schools.com that I should do a nbr*10 /10 but that wasn't enough so I added a math.round
here is how I calculate this :
I use *100 because some weights are like 7.25
so you're right, each time I add an item, I can add a little error ...
but with my first test, I had only seven objects, each of them had only one figure after the dot,
so the biggest possible error should be 0.7 , and I really thing I see too big
but the error was 2.0
thanks for the idea, as I store each selected item in an array,
maybe I can try to recalculate the sum with each of them ...
I'll try do do it =)
for the moment I'm trying to put folder's names, Items and weights in an xml file to build my table ( that will be much more easier to update later ^^) but I think I misunderstood the good way to write it,
my pb is there are sometimes 2 or 3 folders and several items for each <tr>
gonna search deeply tonight about it first
I also have pb with red color around icons when the weight of items is > remaining space ...
it works, but not for all images o_O, and once they're red, I just can't remove this color even if total weight is decreased ...
As I haven't yet became crazy because of this, I think I'm gonna find how to write it , well, I hope so
thanks guys

and you're right, that can be part of explanation

I had some error like : 0.1 + 0.2 = 0.2999999999
then I read on w3schools.com that I should do a nbr*10 /10 but that wasn't enough so I added a math.round
here is how I calculate this :
Code: Select all
totalWeight = Math.round(totalWeight * 100 + imageWeight * 100) / 100;
so you're right, each time I add an item, I can add a little error ...
but with my first test, I had only seven objects, each of them had only one figure after the dot,
so the biggest possible error should be 0.7 , and I really thing I see too big

but the error was 2.0
thanks for the idea, as I store each selected item in an array,
maybe I can try to recalculate the sum with each of them ...
I'll try do do it =)
for the moment I'm trying to put folder's names, Items and weights in an xml file to build my table ( that will be much more easier to update later ^^) but I think I misunderstood the good way to write it,
my pb is there are sometimes 2 or 3 folders and several items for each <tr>
gonna search deeply tonight about it first

I also have pb with red color around icons when the weight of items is > remaining space ...
it works, but not for all images o_O, and once they're red, I just can't remove this color even if total weight is decreased ...
As I haven't yet became crazy because of this, I think I'm gonna find how to write it , well, I hope so

thanks guys

Re: About the weight of objects
I hope that it helps you solve at least some of your issues.
Running into a problem like that kind of make you appreciate what the team at Nadeo goes through. Can you imagine trying to find and pin down an illusive bug in such a huge and structured program as Maniaplanet? This is one reason I tend to defend them so often when people get on them about stuff. They are a small team that does a lot of good work.
Good luck with the rest of your tool.

Running into a problem like that kind of make you appreciate what the team at Nadeo goes through. Can you imagine trying to find and pin down an illusive bug in such a huge and structured program as Maniaplanet? This is one reason I tend to defend them so often when people get on them about stuff. They are a small team that does a lot of good work.
Good luck with the rest of your tool.
CPU: Intel I7-4770 64Bit @ 3.4Ghz.
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
-
- Posts: 174
- Joined: 30 May 2013, 09:40
Re: About the weight of objects
hi all,
coming back with some news
I still have this little problem about weight of objects that is sometimes bigger when together in a map than when alone in separate maps ...
an example with only two objects from same builder and with almost same textures :
weight for these objects alone in a map :
C_Walls/C_Transition_R32 by Dag@bert : 217.7 KB
C_Walls/C_Transition_R31 by Dag@bert : 217.5 KB
so together, as same builder and almost same texture, that should give us 435.2 KB
but if you try to save a map with them, you'll have a message telling total weight is 444.8 KB
I know it's too big to embed them together, but that was just to show an example
the other thing I come here for, is to show you what I've been doing until now and get your opinion :
I've been spending a lot of time to understand how to catch information from an XML file with javascript, but now it works
And as I changed the way to know if an object was already chosen or not, this tool should be much speedier than before
Almost everything is written in HTML, CSS and Javascript (so once the page is loaded you don't have to wait for the server's response when selecting or unselecting an object), the only thing in php is a little visitors counter, just to know because I'm curious
As I know you don't have all objects in your game (for example VioK's ones), I've add a button at the beginning of each row so that we can remove a row of the table we don't have ingame.If you want to see again a row, the only solution is to reload the page ... so removing rows should be only done before choosing objects =)
As you can see with CanyonTurbos and C_Cont folders, we only have 15 objects by row, like ingame
I've been making some icons for objects that haven't any ingame too, so we can easily know who's who without trying all of them
I've only kept embeddable objects I found on ManiaPark (and those I made
), if you find some that I forgot, don't forget to come and tell it here
The only objects that I still have to add now are those from Canyon_Extensions title pack from Dag@bert,
as it was possible to download only objects of it on ManiaPark ( not anymore because the download link gives us the locator
), I will add them as soon as I will have some time to work on them, as I don't have any weight or icons for the moment for them atm, it should take me some little time ..
now, I need some help to see if it's working with all web browsers ..
I know it works with firefox and chrome, but I'm not sure for others
please try to select, unselect and reselect objects to see if it really works (chrome gave me some problems with that)
here are too links, with two ways to display my table : just tell me what you prefer and why
:
http://viokbc.free.fr/tools/objects_wei ... est3.3.php
http://viokbc.free.fr/tools/objects_wei ... est3.4.php
coming back with some news

I still have this little problem about weight of objects that is sometimes bigger when together in a map than when alone in separate maps ...
an example with only two objects from same builder and with almost same textures :
weight for these objects alone in a map :
C_Walls/C_Transition_R32 by Dag@bert : 217.7 KB
C_Walls/C_Transition_R31 by Dag@bert : 217.5 KB
so together, as same builder and almost same texture, that should give us 435.2 KB
but if you try to save a map with them, you'll have a message telling total weight is 444.8 KB
I know it's too big to embed them together, but that was just to show an example

the other thing I come here for, is to show you what I've been doing until now and get your opinion :
I've been spending a lot of time to understand how to catch information from an XML file with javascript, but now it works

And as I changed the way to know if an object was already chosen or not, this tool should be much speedier than before

Almost everything is written in HTML, CSS and Javascript (so once the page is loaded you don't have to wait for the server's response when selecting or unselecting an object), the only thing in php is a little visitors counter, just to know because I'm curious

As I know you don't have all objects in your game (for example VioK's ones), I've add a button at the beginning of each row so that we can remove a row of the table we don't have ingame.If you want to see again a row, the only solution is to reload the page ... so removing rows should be only done before choosing objects =)
As you can see with CanyonTurbos and C_Cont folders, we only have 15 objects by row, like ingame

I've been making some icons for objects that haven't any ingame too, so we can easily know who's who without trying all of them

I've only kept embeddable objects I found on ManiaPark (and those I made


The only objects that I still have to add now are those from Canyon_Extensions title pack from Dag@bert,
as it was possible to download only objects of it on ManiaPark ( not anymore because the download link gives us the locator

now, I need some help to see if it's working with all web browsers ..
I know it works with firefox and chrome, but I'm not sure for others
please try to select, unselect and reselect objects to see if it really works (chrome gave me some problems with that)
here are too links, with two ways to display my table : just tell me what you prefer and why

http://viokbc.free.fr/tools/objects_wei ... est3.3.php
http://viokbc.free.fr/tools/objects_wei ... est3.4.php
Re: About the weight of objects
The game indicates the sizes in kilobytes not in kibibyte.BusardCendre wrote:I still have this little problem about weight of objects that is sometimes bigger when together in a map than when alone in separate maps ...
an example with only two objects from same builder and with almost same textures :
weight for these objects alone in a map :
C_Walls/C_Transition_R32 by Dag@bert : 217.7 KB
C_Walls/C_Transition_R31 by Dag@bert : 217.5 KB
so together, as same builder and almost same texture, that should give us 435.2 KB
but if you try to save a map with them, you'll have a message telling total weight is 444.8 KB
444.8 KB are therefore actually 434.4 KB (what is quite close to 435.2 KB, and note also that my tool rounds up/down).
If you calculate only with bytes, then you get fairly accurate results.
I've updated my tool accordingly.
-
- Posts: 174
- Joined: 30 May 2013, 09:40
Re: About the weight of objects
Thanks, it should be useful for laterElectron wrote:I've updated my tool accordingly.

and thanks for all your tools, they helped me a lot

but you just made me a big fright !!!
I just thought to myself : " is he telling me I have to rebuilt as many maps as there are objects ? "
because I have finished half an hour ago with Canyon objects ...

and there are 519 !!
I'm sure you understand why you scared me !!
In fact, if I have well understood, the problem is about the 1024 bytes in a kilo ...
As I had read on the net that 1000 bytes = 1 kB (lowercase here)
and that 1024 bytes = 1 KB a kibibyte as you just wrote ( I had never heard this word before ... )
and that your tool gives me weights in KB,
I thought it was the good one ...
and effectively, if I make 434.4 * 1.024 then I get 444.8256
434.4 is with your tool and 444.8 is ingame ...
well after a brief reflection, ( tell me if i am wrong ) I don't need to reuse your new version tool with the 519 embeddable objects for Canyon ... I just need to change the way it calculate by multiply weights by 1.024, isn't it ?
Please tell me this will be enough

Oh and as I'm here, a little question for everybody : isn't there any of you who have tried my tool with another web browser than Firefox or Chrome ?
if yes, does it work ?, is there any problem with the tooltip , or with anything else ?
Re: About the weight of objects
Within a personal message I've described you a very fast way to determine the exact weight of an item.BusardCendre wrote:I just thought to myself : " is he telling me I have to rebuilt as many maps as there are objects ? "
You don't need to save a single map or using an external tool.
Tested with Microsoft Internet Explorer 11. Works without problems.BusardCendre wrote:Oh and as I'm here, a little question for everybody : isn't there any of you who have tried my tool with another web browser than Firefox or Chrome ?
if yes, does it work ?, is there any problem with the tooltip , or with anything else ?
-
- Posts: 174
- Joined: 30 May 2013, 09:40
Re: About the weight of objects
Thanks Electron for this way to get weights
gonna make it once again ... this time there won't be any problems
well except if I don't write in my XML the weight I read : I just noticed that I had made some mistakes the first time while getting weights
this time I'm gonna work a little bit slower
thanks too for the feedback with IE ...
anyone has tested with Opera ? just to be sure that CSS is good

gonna make it once again ... this time there won't be any problems

well except if I don't write in my XML the weight I read : I just noticed that I had made some mistakes the first time while getting weights


thanks too for the feedback with IE ...
anyone has tested with Opera ? just to be sure that CSS is good
Re: About the weight of objects
hey,
yeah, it works fine with opera 32 (is the current version)
why do you have the remove button, you have to refresh the browser to see all objects again and if you click on the false list and you wanna get it back, you have to refresh, but then you will get all items again. it's specially annoying if you are using just a certain mix of block categories.
my idea:
you can do instead of the remove-button a hide function like spoilers (in other forums)
yeah, it works fine with opera 32 (is the current version)

why do you have the remove button, you have to refresh the browser to see all objects again and if you click on the false list and you wanna get it back, you have to refresh, but then you will get all items again. it's specially annoying if you are using just a certain mix of block categories.
my idea:
you can do instead of the remove-button a hide function like spoilers (in other forums)
Re: About the weight of objects

May it´s possible to insert this as a selfmade plug-in into the editor? I don´t know anything about the plug-in writing for maniaplanet (editor plug-ins), but there´s a possibility to write something by your own (i saw some selfmade plug-ins for automatic map creation etc.), your calculator there and a small window with the total used size (like on your webpage) would be nice^^
Your webpage is for pre-calculation very useful but not ingame while using some items of a personal library (on the user hdd) and tabbing out of the game into the browser and back is not such charming as we like it

Idea for your webpage:
May you could make some filter options to filter the items by author / envi / name or whatever is useful?
AND Nadeo should uplift the total size for embed items (asked so much times before by many users but no reaction by nadeo^^)

All of my TM2 skins > http://www.maniapark.com/liste_car.php?a=24451&aS=24451
All of my TM2 items > http://www.maniapark.com/liste_object.php?game=1
All of my TM2 items > http://www.maniapark.com/liste_object.php?game=1
Who is online
Users browsing this forum: No registered users and 1 guest