devolution

Author Topic: General Discussion  (Read 3788337 times)

0 Members and 12 Guests are viewing this topic.

Offline fires_flair

  • Sr. Member
  • ****
  • Posts: 411
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #420 on: February 26, 2013, 09:16:25 PM »
I think it would be interesting to know how much each girl makes. (so you know if she's a profitable girl or not)
when you say keep track of the amount for the whole day, do you mean like just have a number (be it positive or negative), and just having the profit added or loss subtracted from that, or actually keeping track of them separately for the whole game.

Personally, I don't care which is done, because it's really not that big of a deal. But if you are going to keep track I'd just have the shift over view + total profit (or loss as the case may be) for each girl.
The shift over view, only so I can keep an eye on why the girl ain't making money, or if it's changed.

and on the picture part, have you guys thought of using file folders, instead of file names, I know it's been suggested before on the forum. if needed (though sorta complicates it) it could be file folder +file name (file: pregnant. file name: profile/ sex /group just for example). I am just thinking about the problems WM had getting preg picture to work properly (and myself remembering how to label them properly)
« Last Edit: February 26, 2013, 09:24:56 PM by fires_flair »

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #421 on: February 27, 2013, 03:21:21 AM »
Ok, lets say someone actually tags 15000 images... What's the next step? Can you explain me two things in Laymans terms:

1) How do we transfer these image tags into a Python class?

2) How do we call such an image?


1) read XMP metadata from the image file and remember which file paths are tagged with which tags; the classes associated with my ImageDatabase class do that;

2) A simple request could be:
img = imgdb.get_image("sex - blowjob", "character - Asuka")

In Pytherworld, I create a group of tags that describes the image I am looking for. For example, the code that selects a picture for a character that shows this character being sold at a slave auction:
Code: [Select]
        required, bonus, excluded = character.get_tags()
        bonus.add("other clothing - nude")
        bonus.add("sex - bondage")
        bonus.add("indoor - basement")
        sextags = core.tagini.get_tags("sex", categorized=True)
        sextags.remove("sex - bondage")
        sextags.remove("sex - lockdown")
        sextags.remove("sex - touch")
        excluded.update(sextags)
        excluded.add("misc - generic")
        excluded.add("misc - portrait")
        imgctrl = core.imgdb.select_image(required, bonus, excluded)
This code results in a search for a picture that fulfills the following conditions:
* It shows the character
* The character is not participating in any activity of the sex category, except for "sex - bondage", "sex - lockdown", or being touched
* The image is no generic image and also not a portrait
* Images where the character is nude, in bondage and in a basement-like location are preferred

Selecting a picture like that is hard to do with your system, unless you create a specific category for that. However, each additional category in your system means additional image files to copy and rename. An additional category in my system can be added as an afterthought without any involvment from the girlpack authors. Just select a combination of tags and you have created a new category.



Quote
It still seems like an insane idea to me... workload seems monstrous
I still don't get how copying a bunch of files into a folder and tagging them with imgtag should take longer than copying a bunch of files into a folder and rename each one of them.

Quote
to spend an year to slightly improve two or three things in the game instead of adding new kickass features...
My tagging system is a lot more powerful than the system we use here in PyTFall. It is also more complicated though. Since you are obviously convinced the current PyTFall system is good enough, I suggest we stick with it. I don't care either way as I don't have to work with it ;-)

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #422 on: February 27, 2013, 03:31:45 AM »
I think it would be interesting to know how much each girl makes. (so you know if she's a profitable girl or not)
when you say keep track of the amount for the whole day, do you mean like just have a number (be it positive or negative), and just having the profit added or loss subtracted from that, or actually keeping track of them separately for the whole game.

Personally, I don't care which is done, because it's really not that big of a deal. But if you are going to keep track I'd just have the shift over view + total profit (or loss as the case may be) for each girl.
The shift over view, only so I can keep an eye on why the girl ain't making money, or if it's changed.

Well, I  thought about it when I was falling asleep and this seems to be a decent approach:

- We keep track of girl earning (during Jobs) and log those in on per day bases without specifying the job she was doing.
 - We keep track of wages girl enjoys from doing jobs and upkeep, also per day. That is for free girls, for slaves we just record upkeep.
 - We keep track on Brothel fees like advertising and cleaning (Unless done by girls themselves).
 - We record players gold on hand each day.
 - We record money made from missions in the future.


 - Based on those logs, we can generate information on previous days earnings per brothel and per girl and also create a per day report on demand.


I think this will be enough. I don't want to add money spent on items or during quests here, for the simple reason that entire items system will be changed when we switch from SimBrothel version to WM version.



and on the picture part, have you guys thought of using file folders, instead of file names, I know it's been suggested before on the forum. if needed (though sorta complicates it) it could be file folder +file name (file: pregnant. file name: profile/ sex /group just for example). I am just thinking about the problems WM had getting preg picture to work properly (and myself remembering how to label them properly)

This will work worse than just filenames. It's easier to encode more info about the pics in files names or take Rudi's approach with tags. But system at place is already quite good, we may just leave everything as it is. Problems with preg type of pics will not find their way from WM to PyFTall, that's not possible.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #423 on: February 27, 2013, 05:30:07 AM »
Lets land our alien picturetagging spaceship for a moment
Too bad. I like sci-fi  :D

Possibility 2:

- We keep track of earnings (Work) and expenditures (Upkeep, wages, school fees, advertising, upgrades etc.) for the duration of the whole game and add that number to girl's profile screen and brothel's screen.

Workload 4 - 6 hours.
I think this is the best way. Question is, if we going to track many stats for many girls, how many RAM and free disk space game will need after a couple of ingame months or years?
Another thing is interface. I thought about graphs of some kind, at least for most important stats, but I don't know how well Python can handle such things.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #424 on: February 27, 2013, 05:39:09 AM »

1) read XMP metadata from the image file and remember which file paths are tagged with which tags; the classes associated with my ImageDatabase class do that;

2) A simple request could be:
img = imgdb.get_image("sex - blowjob", "character - Asuka")

In Pytherworld, I create a group of tags that describes the image I am looking for. For example, the code that selects a picture for a character that shows this character being sold at a slave auction:
Code: [Select]
        required, bonus, excluded = character.get_tags()
        bonus.add("other clothing - nude")
        bonus.add("sex - bondage")
        bonus.add("indoor - basement")
        sextags = core.tagini.get_tags("sex", categorized=True)
        sextags.remove("sex - bondage")
        sextags.remove("sex - lockdown")
        sextags.remove("sex - touch")
        excluded.update(sextags)
        excluded.add("misc - generic")
        excluded.add("misc - portrait")
        imgctrl = core.imgdb.select_image(required, bonus, excluded)
This code results in a search for a picture that fulfills the following conditions:
* It shows the character
* The character is not participating in any activity of the sex category, except for "sex - bondage", "sex - lockdown", or being touched
* The image is no generic image and also not a portrait
* Images where the character is nude, in bondage and in a basement-like location are preferred

Selecting a picture like that is hard to do with your system, unless you create a specific category for that. However, each additional category in your system means additional image files to copy and rename. An additional category in my system can be added as an afterthought without any involvment from the girlpack authors. Just select a combination of tags and you have created a new category.

I wonder how a XMP parser works... maybe it would be possible to do this?:

This is from an instance of sGirl class:

u'shop': [u'content/chars/naruto/Hinata/shop (2).jpg', u'content/chars/naruto/Hinata/shop (3).jpg'

method of the same class calls a category (shop) and randomly chooses an image from the list.
----------------------------
What if during the creation of an instance, we also read XMP tags and created a dict with picture path being a key and tags being values (another list).

Then we edit method as well, call it with a new kwarg 'tags' that goes through all images in shop category and tried to find the best match for the situation. This way almost nothing would have to be changed in game makeup and we would have a system that is not quite as powerful as the one in PytherWorld but still packs some heat and offers a good deal of possibilities.

PS: Renaming pics is easy in batches, I have a whole system for that.

My tagging system is a lot more powerful than the system we use here in PyTFall. It is also more complicated though. Since you are obviously convinced the current PyTFall system is good enough, I suggest we stick with it. I don't care either way as I don't have to work with it ;-)

I once wrote a post about game 'generations'. I don't remember where but the idea was:

First Generation Hentai Indie Sim Games:

SimBrothel
Slavemaker
Hentai Highschool

They had a fairly straightforward interface and logic and allowed none to little moddability.

Second Generation Hentai Indie Sim Games:

SlaveMaker 2
WM
SimBro 1x

These allow much better moddability, better graphics (In some cases), more advanced logic.

Third Generation Hentai Indie Sim Games:

SlaveMaker 3
OtherWorld

These allow unreasonable possibilities for moddability, better logic, more content and so on.

As you can see, WM and SimBrothel are missing from the list of third generation, because WM2 has never been created and all SimBrothel project that tried to climb up there failed miserably.

So my objective is to build a third generation SimBrothel and WM, with advanced job system where jobs effect one another, social system, slave training and multiple stat/skill variations, battleengines, quests, events and missions, highly graphical interface. I don't want to be sidetracked by making it to advanced, simply because there will eventually be Fourth generation at some point that might have even better jobs system, near perfect image handling, better quests system and so on. Maybe after I am finished with PyTFall projects, I will build a game like that, but for now I don't want to spend to much time on features that are overcomplicated.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #425 on: February 27, 2013, 05:50:06 AM »
I think this is the best way. Question is, if we going to track many stats for many girls, how many RAM and free disk space game will need after a couple of ingame months or years?

It shouldn't be to bad, text doesn't take to much ram or space. We can use .xml file or database otherwise, but that's not something I am eager to do...


Another thing is interface. I thought about graphs of some kind, at least for most important stats, but I don't know how well Python can handle such things.

Will take more time then it's worth, python is perfect for building a graph but RenPy will need  modified classes. Also there is another issue, I don't want to log stat increases through out the game, it will take even more effort, and you cannot build a graph without that.
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #426 on: February 27, 2013, 07:00:41 AM »
Question is, if we going to track many stats for many girls, how many RAM and free disk space game will need after a couple of ingame months or years?
Don't worry about system ressources, those are growing way faster than we can code. In addition, you need to throw A LOT of work on modern systems to even notice a delay. Just do what you think is the best way to solve your problem and only worry about performance if your program becomes to slow. Premature optimization is the root of all evil ;-)
The only platform which would be performance-sensitive IMHO are Atom-based Netbooks, but those will be obsolete soon enough.

Quote
I wonder how a XMP parser works...
Basically it opens the file, scrolls to the part of the file that contains XMP metadata, reads the data there, closes the file and returns the data as a Python object. Therefore, this is quite a lot slower then simply reading the file name from the file system. In Pytherworld, I do this at "compile time", when I package the game into an executable. I would not recommend doing that every time you create a sGirl instance, as it would slow down character creation tremendously. There is also no reason to to that, unless you intend to change tags in image files during runtime.

How your program remembers the relationship between tags and image file paths really depends on what you want to accomplish. What you suggest is certainly doable.

If you want, I could certainly create a draft of a comparatively simple ImageDatabase class. I had a much simpler concept than I use today implemented in an earlier version of imgtag.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #427 on: February 27, 2013, 07:23:10 AM »
How your program remembers the relationship between tags and image file paths really depends on what you want to accomplish. What you suggest is certainly doable.

If you want, I could certainly create a draft of a comparatively simple ImageDatabase class. I had a much simpler concept than I use today implemented in an earlier version of imgtag.

 Class... you're basically suggesting to create one single gallery class and throw all pictures in there... I was thinking about something simpler. Also there is no compile time with RenPy other than that happens on run-time, at least non that I am aware of.

 I would think that if there is a good parser, simple function would have to be written to use that parser to extract data and add it to a dict as values.

Can you write that function?


More to the point:

                for file in os.listdir(renpy.loader.transfn(imagedir)):
                    acttype = file.split()[0]
                    file = "%s/%s"%(imagedir,file)
                    if content[key].__dict__['gfx'].has_key(acttype):
                        content[key].__dict__['gfx'][acttype].append(file)
                    else:
                        content[key].__dict__['gfx'][acttype] = [file]



Instead, lets say you write a function that loads tags from the file and we call it "rudis_tagloader()" that takes file path and filename as argument (simply a variable called file in the above function) and returns a list or a dict of tags:

we rewrite that to:

                    if content[key].__dict__['gfx'].has_key(acttype):
                        content[key].__dict__['gfx'][acttype].append(dict(file = rudis_tagloader(file)))
                    else:
                       
content[key].__dict__['gfx'][acttype] = [dict(file = rudis_tagloader(file))]               


If that is possible, we don't even have to change one thing, I'll simply rewrite img method to use tagged images if tag is requested as an argument of a method. We'll still have to rename all files but it's very easy to do and tags will be very helpful!
« Last Edit: February 27, 2013, 08:00:03 AM by Xela »
Like what we're doing?

Offline GonDra

  • Full Member
  • ***
  • Posts: 154
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #428 on: February 27, 2013, 08:15:37 AM »
Possibility 2:

- We keep track of earnings (Work) and expenditures (Upkeep, wages, school fees, advertising, upgrades etc.) for the duration of the whole game and add that number to girl's profile screen and brothel's screen.

Workload 4 - 6 hours.
Would get my vote - I would like option 3 but I don't think there would be anything to gain for a normal player there. Only thing I would like added to this is a simple screen for the brothel finances.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #429 on: February 27, 2013, 08:29:43 AM »
Would get my vote - I would like option 3 but I don't think there would be anything to gain for a normal player there. Only thing I would like added to this is a simple screen for the brothel finances.

I think I'll make that a part of the brothel screen itself. Or as a pop up screen on click of a button. In any case, option two it is.
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #430 on: February 27, 2013, 09:02:00 AM »
I postpone working on girls until you decide tags to prevent doing things twice, and start looking for location backgrounds instead and continue to gather girlmeet lines.


Because there are lot things changing a lot, I decided not to add them directly into a script now afterall. So I have a important question - and not only about girlmeet lines - do you want me to write texts I have now in a file, and if, how a file with written texts should look like to be easy for codder to use it, or should I just keep them for myself and wait until I fully understand where to place them and then do it (=later, but no work for anyone else)








Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #431 on: February 27, 2013, 09:03:02 AM »
As I worked with texts, I give some thought to adding Bisexual trait as well. Then again, since sexual orientation is something every character has, maybe we should use one variable somewhere in xml instead of 3-4 traits?
« Last Edit: February 27, 2013, 09:04:56 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #432 on: February 27, 2013, 10:34:11 AM »
As I worked with texts, I give some thought to adding Bisexual trait as well. Then again, since sexual orientation is something every character has, maybe we should use one variable somewhere in xml instead of 3-4 traits?

You mean like male/female/shemale/futanari? That would mean that many texts and jobs be a subject to change and adaptation. Prolly not worth it.

I postpone working on girls until you decide tags to prevent doing things twice, and start looking for location backgrounds instead and continue to gather girlmeet lines.

Please proceed as planned. I've already decided to use picture categories or picture categories with tags combination if Rudi can create a function I asked for.

For background locations try taking a look on Roman's resources (that's the guy who I learned game programming from and programmer for Alkion). Folder names are in Russian but once you get inside, it's obvious what category you're in:

https://www.dropbox.com/gallery/11931230/1/Resources?h=8f251a

These are: City - Places of rest backgrounds for example:
https://www.dropbox.com/gallery/11931230/1/Resources/Backgrounds/%D0%93%D0%BE%D1%80%D0%BE%D0%B4%20-%20%D0%BC%D0%B5%D1%81%D1%82%D0%B0%20%D0%BE%D1%82%D0%B4%D1%8B%D1%85%D0%B0/?h=8f251a


Because there are lot things changing a lot, I decided not to add them directly into a script now afterall. So I have a important question - and not only about girlmeet lines - do you want me to write texts I have now in a file, and if, how a file with written texts should look like to be easy for codder to use it, or should I just keep them for myself and wait until I fully understand where to place them and then do it (=later, but no work for anyone else)

Can you throw what you've gathered for one of the girlsmeets to a text file? I'll take a look at it and we decide on what to do with the rest.
« Last Edit: February 27, 2013, 10:42:36 AM by Xela »
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #433 on: February 27, 2013, 12:57:45 PM »
Code: [Select]
import os
import pyexiv2
def load_tags(dirpath, filename):
    '''Returns a list of tags stored as XMP metadata in the file at imgpath.
    '''
    imgpath = os.path.join(dirpath, filename)
    # read the metadata of the file at imgpath
    metadata = pyexiv2.ImageMetadata(imgpath)
    metadata.read()
    # read the XMP tag information in the metadata
    if "Xmp.dc.subject" in self.metadata.xmp_keys:
        tags = metadata["Xmp.dc.subject"].value
    else:
        tags = []
    return tags
Here you go.

This code requires the pyexiv2 library to run. I'm not sure how to package external libraries with RenPy. I've uploaded the offical installer of pyexiv2 as well as a zip with the contents of the installer to my dropbox folder. I think if you just copy the contents of the installer directly into a directory that is in the PYTHONPATH you should be fine. To find a directory that is on the PYTHONPATH include "print sys.argv[0]" somewhere in your code.

Btw, 'file = "%s/%s"%(imagedir,file)' is kinda dangerous on Windows. If whatever you feed this path into expects a UNIX path, all is well, but if that thing expects a windows path, this code will fail. If it is unsure what path convention should be used, it is better to use 'file = os.path.join(imagedir, file)', because that will always return a path valid for the current OS.

Quote
Also there is no compile time with RenPy other than that happens on run-time, at least non that I am aware of.
You are very right, Python is an interpreted language and therefore Python programs don't have a compile time - that's why I put the expression in parentheses. What I meant was that I would read the tags in the images when the game is packaged for a release, not at runtime when players load the game and certainly not during instantiation of a new character. This will be really slow for 15000 image files (think 15 minutes here, maybe more).

EDIT: Just realized you wanted a function that takes the dirpath and filename. Fixed.
« Last Edit: February 27, 2013, 01:18:38 PM by rudistoned »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: SimBrothel: -PyTFall- Dev Thread: Writers needed!
« Reply #434 on: February 27, 2013, 01:51:31 PM »
You mean like male/female/shemale/futanari? That would mean that many texts and jobs be a subject to change and adaptation. Prolly not worth it.
Nope, I mean Frigid, Lesbian, Hetero (I guess we can call it a "hidden trait", since if girl is not something else, she is a Hetero) and Bisexual.
I think it makes more sense than traits system. Because girl may or may not have any particular trait, but she can't have any sexual orientation at all. For example, take a look at Slavemaker, it has an "orientation bar" which changes during the game depending on girl actions rather than a fixed value.

You could tell the same about boobs, they can be small or huge, but they are exist anyway  :)
Current "boobs system" was taken from wm ex, but I begin to doubt that decision.
Of course, if it means a lot of work for you, than forget about it. Current system is working too, after all.
« Last Edit: February 27, 2013, 02:27:29 PM by DarkTl »