Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 16, 2015, 10:07   #41
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,608
PowerWyrm is on a distinguished road
Hmm there's something that's bothering me about object_base.txt, even more when I look from my variant's perspective.

Before the commit that nuked tval_to_attr, the default attr for inventory display was put into a pref file (font-xxx.prf), which clearly could be changed by the player. All other info bits, especially breakage chance and object flags, are clearly game core info and should NOT be changed by the player.

For my variant's perspective, the font-xxx.prf info was parsed on the client and transmitted to the server, which then used that info to display items in inventory for each player. The object_base.txt info was parsed on the server and therefore was used for all players.

At this point I have two unsatisfactory options:
- parse object_base.txt on the server and set the same default attr for inventory display for all players
- parse object_base.txt on both client and server and only transfer the attr to the server

For now I'll implement option #2.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 16, 2015, 10:26   #42
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,608
PowerWyrm is on a distinguished road
Nevermind. The txt files in /lib/edit are server-side files and should not contain any player configurable info. Therefore the only thing I can do is implement option #1 and set the same default attr for inventory display for all players.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 16, 2015, 11:35   #43
Carnivean
Knight
 
Join Date: Sep 2013
Posts: 526
Carnivean is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
- parse object_base.txt on the server and set the same default attr for inventory display for all players
I'm not 100% sure what you're talking about, but can't you have the server deal with the default, and then have the client side interpret the value from the server into whatever the player has configured? Or vice versa?
Carnivean is offline   Reply With Quote
Old March 16, 2015, 12:50   #44
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,608
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Carnivean View Post
I'm not 100% sure what you're talking about, but can't you have the server deal with the default, and then have the client side interpret the value from the server into whatever the player has configured? Or vice versa?
No, because the txt files are tied to game core, not game preferences. You cannot let players choose core properties like object or monster flags, it would make no sense (player edits monster.txt, set Morgoth hp to 1...).
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 16, 2015, 13:18   #45
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,002
fizzix is on a distinguished road
I think it highlights a failure of the core-ui split where display information is encoded in the edit files alongside gameplay information. I guess for now your solution is best, parse the player information and only pass over the display stuff.

I'm not sure if splitting everything up into two separate files is the way to go. Then you would need to make edits in two places anytime you wanted to add or remove an object or item, which is a bit of a pain.
fizzix is offline   Reply With Quote
Old March 16, 2015, 16:40   #46
Carnivean
Knight
 
Join Date: Sep 2013
Posts: 526
Carnivean is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
No, because the txt files are tied to game core, not game preferences. You cannot let players choose core properties like object or monster flags, it would make no sense (player edits monster.txt, set Morgoth hp to 1...).
I should have been clearer, I meant just for the display properties that you were talking about.
Carnivean is offline   Reply With Quote
Old March 16, 2015, 19:50   #47
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,652
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
Before the commit that nuked tval_to_attr, the default attr for inventory display was put into a pref file (font-xxx.prf), which clearly could be changed by the player. All other info bits, especially breakage chance and object flags, are clearly game core info and should NOT be changed by the player.

For my variant's perspective, the font-xxx.prf info was parsed on the client and transmitted to the server, which then used that info to display items in inventory for each player. The object_base.txt info was parsed on the server and therefore was used for all players.
I consider this a bug to be fixed - presumably by restoring font-xxx.prf and a function equivalent to tval_to_attr.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is online now   Reply With Quote
Old March 23, 2015, 13:52   #48
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,608
PowerWyrm is on a distinguished road
Currently implementing the removal of the FEAT_WALL constants in profit of SQUARE_WALL flags. Found a little error in mutate_cavern(): FEAT_WALL_SOLID was replaced by FEAT_GRANITE, but square_set_feat was not replaced by set_marked_granite, so the SQUARE_WALL_SOLID flag is never set. The code should probably be:

Code:
    for (y = 1; y < h - 1; y++)
    {
        for (x = 1; x < w - 1; x++)
        {
            if (temp[y * w + x] == FEAT_GRANITE)
                set_marked_granite(c, y, x, SQUARE_WALL_SOLID);
            else
                square_set_feat(c, y, x, temp[y * w + x]);
        }
    }
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 23, 2015, 14:09   #49
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,608
PowerWyrm is on a distinguished road
The draw_rectangle() method is badly written (and there's a nice typo), considering that generate_mark() already iterates on a rectangular area. It should be:

Code:
    for (y = y1; y <= y2; y++)
    {
        square_set_feat(c, y, x1, feat);
        square_set_feat(c, y, x2, feat);
    }
    if (flag)
    {
        generate_mark(c, y1, x1, y2, x1, flag);
        generate_mark(c, y1, x2, y2, x2, flag);
    }

    for (x = x1; x <= x2; x++)
    {
        square_set_feat(c, y1, x, feat);
        square_set_feat(c, y2, x, feat);
    }
    if (flag)
    {
        generate_mark(c, y1, x1, y1, x2, flag);
        generate_mark(c, y2, x1, y2, x2, flag);
    }
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 23, 2015, 20:15   #50
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,652
Donated: $60
Nick is on a distinguished road
Thanks, done and done.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restructure update Nick Development 80 February 25, 2015 20:56
Ladder restructure request OOD Town drunk Vanilla 7 April 4, 2013 16:11
Implementing different difficulty levels Greebley Vanilla 14 January 11, 2012 14:39


All times are GMT +1. The time now is 12:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.