Grumpycoder
July 04, 2008, 12:22:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Migration to the new server complete.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: How it works.  (Read 15398 times)
Pixel
Administrator
Jr. Member
*****

Karma: +8/-0
Posts: 76



View Profile
« on: January 15, 2008, 07:55:01 PM »

Here's a little guide about how to use the software. Check this regularly, since we may change the way to operate it without notice.

First, enter your character data here:

http://grumpycoder.net/signatures/generate.html

You'll get redirected to a page where you can see the link of your picture, like this one:

http://grumpycoder.net/signatures/e4d2d584df195ef6e750142ef5b378b0/signature.jpg


Displaying the picture should get you a 150x150 avatar, like this one:




The picture should update itself from time to time, but if it does during armory breakdown, the picture might stay in a strange state. So, in order to flush the cache of the software, you simply have to hit the following URL:

http://grumpycoder.net/signatures/e4d2d584df195ef6e750142ef5b378b0/taint.txt


and then, the next time you'll look at the picture, it'll refresh itself from armory.

You can also modify the link and replace signature.jpg by avatar.jpg, to have an forum-friendly avatar for forums:
« Last Edit: January 18, 2008, 11:02:17 AM by Green » Logged
teakan
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #1 on: January 22, 2008, 05:23:59 PM »

Well done!  I'm very impressed.  I'm interested in how you accomplished this! Could you share technical details with us code monkeys?  Did you compile/modify wow model viewer?
Logged
Pixel
Administrator
Jr. Member
*****

Karma: +8/-0
Posts: 76



View Profile
« Reply #2 on: January 22, 2008, 06:03:19 PM »

Yes, we will probably share more details in the near future, we just are both very busy with both the coding of the server, and our real jobs, so this is not really easy Smiley

To answer your direct question, yaz0r did rewrite the wow model viewer from scratch, so to make it fit into my server code architecture, to have a more extensive control on the models rendered, and also to be able to understand how the models were working so to be able to debug the whole thing Smiley So basically everything's written from scratch ^^
Logged
yaz0r
Administrator
Newbie
*****

Karma: +8/-0
Posts: 47



View Profile
« Reply #3 on: January 22, 2008, 06:18:41 PM »

As Pixel said, it's written from scratch. But I admit that I looked closely at the wowModelViewer code for some features, while I did some research to get some part as close as I could to the WoW engine. There is still a lot of work to do (like particles and some material properties), not to say that animations are already hooked in the engine... Smiley
Logged
freyr
Newbie
*

Karma: +0/-0
Posts: 3


View Profile
« Reply #4 on: January 22, 2008, 09:43:09 PM »

what you did is really great Wink

a modelviewer for the web thats something i dreamed of several times, but i cant program in c or c++, so no chance for me to use the model viewer code ...

i have a similar question then the first one, could you perhaps release your project as opensource version? Cheesy , so that we can help to build in new features, help bug fix it, and of course use it for our own websites?

it would be really great to have such a tool on our website (www.massacre-gaming.com) to make screens of our characters, if you make it opensource i would also donate some money Wink

we also have a smal database on our site, right now only items get displayed, but a quests-module and a npcs-module are in the works, my second question is, if you release your tool as opensource version, could you perhaps add the feature to display only one item based on his item-id, that would be great because then we could add it to our wow database on every item page, every time a user visits the page he also gets an image of the item (like the new feature the added to the wowhead db Wink )

if you have reasons to not release it as opensource, i could really understand it, but i only wanted to say, that if you do i would be really happy to try it on our website

freyr (perenolde-eu)
« Last Edit: January 22, 2008, 09:44:53 PM by freyr » Logged
Meia
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #5 on: January 22, 2008, 09:48:56 PM »

THIS IS AMAZING!  Fantastic idea with this.  =D



My character shows as naked, but damn, with the customization thing I got her face and look perfectly.  Smiley
Logged
teakan
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #6 on: January 22, 2008, 10:53:28 PM »

yaz0r - no need for open source man, i was just impressed and wanted to know how you approached this compex task.  i write C#/.NET graphics code so i know how hard you must have worked on this, i'd be very hesitant myself to make something open source that i put that many hours into.

anyways, i'm one of those programmers that's also a designer, so i'd be happy to contribute design templates for the banners, either in PNG format, or using your proprietary XML layout code.

working on an online wow project of my own that i'll share details with when i've got an alpha up.

keep up the great work!  specifying the size and rotation of the model would be pimp btw.

-teakan @ area52
Logged
Pixel
Administrator
Jr. Member
*****

Karma: +8/-0
Posts: 76



View Profile
« Reply #7 on: January 23, 2008, 01:54:15 AM »

Thank you all, this feedback is really appreciated Smiley We worked quite hard in order to make it possible, and we're really proud of the actual result, even if there is still a dozen of features we'd like to add.

Quickly, about Meia's problem: you probably tried to generate your character when the armory was down. I'll add some code later on in order to square this better and display a nice "armory waiting refresh" message instead of a naked character Smiley So much to do. So little time. In the meantime, you can force the refresh of your signature by hitting the "taint.txt" file as stated above.

About the code itself, the fact that the code isn't really released yet has several reasons. But first, all the code used here is already tagged using various licenses, from GPL to BSD, depending on the module - the code itself is split between several modules, of course Smiley

One of our main reason, as you may have already understood, is the wide kind of usages of the engine, even though it looks like the classical wowmodelviewer. You already start to make us donation offers publically, and I can disclose that we also received some other offers privately. So I guess we will probably allow private svn access to our code for a start, so that interested people may contribute. Public access may follow right after. We are not too much suspicious about how our work may be used, but we'd just like to have a solid base before it could be abused.

The second reason is that the code is really, really wicked Smiley Well, that's what you get when you're able to generate OpenGL jpegs on a web application. So it'd be pretty hard to build and to get a "working" version out of it, and I am really not in the mood of doing "technical support" for that part. Yet. Moreover, this is not the kind of webservice that can run on any classical hosting environment. The whole thing is a custom daemon that runs in background, and that is running a custom HTTP server being proxy-forwarded from the main apache server. So it really needs a custom server, not a simple PHP+Apache bundle with FTP access. And a lot of space and power.

Well, in order to show you what I'm talking about, I'll disclose some bits of the code that is running right now, at the end of the post.


So, in all cases, if you're willing to contribute, we may arrange an svn access for you, but be prepared to face heavy C++/Lua code Smiley


We will probably try to provide a service (free or not, that's still the question, we'll do some tests, even though we highly want to release it for free) that renders "XML/RPC" calls possible from an external website to a dedicated server. Well at least we're in the process of buying some dedicated hosting for it, then we'll see what happens Smiley

The XML format is yet to be fully designed, but I am aiming at something like this. (this is not my top priority though)

Code:
<prologue>
  <character name="Foobar" realm="Archimonde" region="eu" varname="mychar1" skin="3">
    <items>
      <item slot="WEAPON" id="19019" sheathed="true" />  <!-- let's override the character with a Thunderfury in main hand, sheathed -->
      <item slot="TABARD" sheathed="true" />  <!-- sheathing a non-weapon item will just hide it -->
    </items>
  </character>
</prologue>
<picture width="450" height="100">
  <ortho left="0" right="1" bottom="0" top="1" near="-1" far="1" />
  <code>
    <!-- fill background with a deep blue gradiant -->
    <![CDATA[
      gl.Begin "QUADS"
      gl.Color(0, 0, 0, 1)
      gl.Vertex(0, 0, 0)
      gl.Vertex(0, 0, 1)
      gl.Color(0, 0, 1, 1)
      gl.Vertex(1, 1, 0)
      gl.Vertex(0, 1, 0)
      gl.End()
    ]]>
  </code>
  <setcamera character="mychar1" fov="45" />
  <draw character="mychar1" />
</picture>


And for your viewing pleasure, here's the pieces of codes I was talking about:

File blog-html.lua:
Code:
print "Loading blog-html.lua..."

local function DumpPage(xm, p, title)
    if p.istop then p = { p } end
    xm:html {
        xmlns = "http://www.w3.org/1999/xhtml",
        ["xml:lang"] = "en",
        lang = "en",

        xm:head {
            xm:meta {
                ["http-equiv"] = "Content-Type",
                content = "text/html; charset=ISO-8859-1",
            },
            xm:meta {
                name = "MSSmartTagsPreventParsing",
                content = "TRUE",
            },
            --[[ some templates...
            xm:link {
                rel = "section",
                href = "/blog/Section",
                title = "Section Title",
            },
            xm:link {
                rel = "archive",
                href = "/blog/2000/01",
                title = "January 2000",
            },
            xm:link {
                rel = "alternate",
                type = "application/rss+xml",
                title = "RSS feed",
                href = "/blog/rss",
            },
            ]]--
            xm:title(title),
            xm:link {
                rel = "stylesheet",
                type = "text/css",
                href = "/css/blog-style.css",
                media = "screen",
            },
        },
        xm:body {
            xm:div {
                id = "ppal",
                xm:div {
                    id = "logo",
                    xm:h1 {
                        xm:comment "Placeholder for CSS logo.",
                    },
                },
                xm:div {
                    id = "nav",
                    xm:span {
                        class = "navelt",
                        xm:a {
                            href = "/blog/",
                            "Blog",
                        },
                    },
                    xm:span {
                        class = "navelt",
                        xm:a {
                            href = "/about",
                            "About",
                        },
                    },
                    xm:span {
                        class = "navelt",
                        xm:comment "Placeholder for the last navigation separator.",
                    },
                },
                xm:div {
                    id = "bas",
                    xm:div {
                        id = "main",
                        unpack(p),
                    },
                    xm:div {
                        id = "col",
                        -- widgets
                        xm:div {
                            class = "colbox",
                            xm:div {
                                class = "colboxtitle",
                                "Some widget",
                            },
                            xm:a {
                                href = "http://www.google.com/",
                                "Google!",
                            },
                            xm:br(),
                        },
                        xm:div {
                            class = "colhr",
                            xm:empty(),
                        },
                        xm:div {
                            class = "colbox",
                            xm:div {
                                class = "colboxtitle",
                                "Sponsors",
                            },
                            xm:a {
                                href = "http://validator.w3.org/check?uri=referer",
                                xm:img {
                                    src = "http://www.w3.org/Icons/valid-xhtml10",
                                    alt = "Valid XHTML 1.0 Strict",
                                    height = "31",
                                    width = "88",
                                },
                            },
                            xm:br(),
                            xm:a {
                                href = "http://jigsaw.w3.org/css-validator/",
                                xm:img {
                                    style="border:0;width:88px;height:31px",
                                    src="http://jigsaw.w3.org/css-validator/images/vcss" ,
                                    alt="Valid CSS!",
                                },
                            },
                            xm:br(),
                            xm:a {
                                href = "http://www.lua.org",
                                xm:img {
                                    src = "http://www.lua.org/images/powered-by-64.gif",
                                    alt = "Powered by Lua",
                                    height = "64",
                                    width = "64",
                                },
                            },
                            xm:br(),
                        },
                    },
                    xm:div {
                        class = "spacer",
                        xm:raw "&nbsp;",
                    },
                },
            },
        },
    }

    return xm:render()
end

local function show_css(request, result)
    result.mime_type = "text/css"

    result.contents:copyfrom(Input "data/blog-style.css")

end

dcss_blog = Domain("^/css/blog-style.css$", show_css)

function blog_CreatePage()
    local r

    r = NewXmlMarkup()

    r.doctype = '<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
    r.DumpPage = DumpPage

    return r
end

print "Loaded blog-html.lua."

File about.lua: (in order to display http://grumpycoder.net/about )
Code:
print "Loading about.lua..."

local function about(req, res)
    local xm, p
    xm = blog_CreatePage()
    res.mime_type = "text/html"

    p = xm:div {
        "Please look at ",
        xm:a {
            href = "http://forum.grumpycoder.net/",
            "our forums",
        },
        " for more information :) More to come soon.",
    }

    res.contents:write(xm:DumpPage(p, "About us"))
end

about_domains = {
    Domain("^/about$", about),
}

print "Loaded about.lua."

(yes, you may think of it as "lua-on-rails" ^^)
« Last Edit: January 23, 2008, 02:07:56 AM by Pixel » Logged
Meia
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #8 on: January 23, 2008, 02:39:47 AM »

Yep, the link worked.  Clicked it then kept refreshing the page til the armor showed.  Now if only Blizz would make their armory update faster, I'd be set.  Stupid hat doesn't match her armor and can't see her face.  :p
Logged
yaz0r
Administrator
Newbie
*****

Karma: +8/-0
Posts: 47



View Profile
« Reply #9 on: January 23, 2008, 10:22:57 AM »

yaz0r - no need for open source man, i was just impressed and wanted to know how you approached this compex task.  i write C#/.NET graphics code so i know how hard you must have worked on this, i'd be very hesitant myself to make something open source that i put that many hours into.

I haven't decided yet if I will release the source publicly or not. If I do, the licences issues are already resolved as my code is LGPL.

Anyway, to clarify things, the server is actualy split in two part. The first is "purple" (from purple tentacle, nothing to do with wow purples), and is Pixel's work. It acts as the http server, fetch data from armory, serve the signatures/avatar files, handle the generation page... For rendering, it creates a character setup and hands it to the second module, called "paperIdol" (pun on Wow's paper doll) that I wrote. Paper (as will usualy call it internaly) handles mesh/textures/animation loading and caching, and use the character setup provided to render the character. For the rendering itself, Paper use OSmesa as an opengl software renderer.
PaperIdol also exists as a standalone windows application, using hardware accelerated opengl to render the character, but this is mainly my work environment.
Logged
freyr
Newbie
*

Karma: +0/-0
Posts: 3


View Profile
« Reply #10 on: January 23, 2008, 11:25:54 PM »

cool this is really great news, thx a lot for the clarifications Wink

im sure you know sourceforge, this could be a good place to release it, if you still want to Wink , cause there people can also donate easily

... i have some more questions, but i think i will wait until the first release and try it out, for example i wonder if we will be able to run your software under linux, do we need a dedicated windows server, or can we host it on shared machines like the ones 1and1.com sells ... can we write php modules that use the core instead of having to use lua and so on ...
« Last Edit: January 23, 2008, 11:29:59 PM by freyr » Logged
Pixel
Administrator
Jr. Member
*****

Karma: +8/-0
Posts: 76



View Profile
« Reply #11 on: January 24, 2008, 12:48:37 AM »

I can already answer a few of them Smiley

-) The software runs under plain linux right now, even though I am able to build a win32 version of it.
-) you "could" be able to host it on a 1&1 machine, but I could say they wouldn't be happy, for a lot of reasons Smiley Mainly because it'd eat a lot of CPU and memory, but also because you need to host the whole game client data. And right now I still have a few problems in terms of ressources.
-) there would be a lot of loopholes running this software in php, mainly because of the multithreading situation. The way I've designed the http engine right now is exactly meant to have a precise control over the threads so to be able to have only one instance of paperIdol running, with its own stack of textureIds and so on and so on. OpenGL is a state machine, which has to coope with context switching. This would eat giant ressources if you just let it to restart from scratch for each picture.

So the whole choice of "Lua" here isn't really relevant. I finally choosed Lua because of the LuaGL library which was already shiny and all. The main thing is that we'd need to have more control over the thread switching stuff.
Logged
freyr
Newbie
*

Karma: +0/-0
Posts: 3


View Profile
« Reply #12 on: January 25, 2008, 11:45:47 PM »

k thx a lot for the new informations, now i undertsand a little bit more whats about

wish you luck for the future developement Wink
Logged
Rummy
Newbie
*

Karma: +0/-0
Posts: 4


View Profile
« Reply #13 on: February 01, 2008, 10:20:47 AM »

Obviously I don't know how the back end works, but I tried it last night and the customization part was too slow to be usable. A thought I had for the customization screen, and I don't know if you do this already - is to pre-render *all* the possible customization images, or cache them as they happen. I know there are a lot, but pre-rendering or caching at least removes the rendering cpu delay at the part of the process where users will to be going through lots of re-renders heading for the one they want.

This morning of course the whole process is much much faster, so maybe the speed wasn't rendering bound.

On the customization front, any chance of getting the +/- to "wrap" when they hit their limits?

Just a thought.
Logged
Pixel
Administrator
Jr. Member
*****

Karma: +8/-0
Posts: 76



View Profile
« Reply #14 on: February 01, 2008, 11:03:30 AM »

Pre-rendering all the possibilities would actually take about 500GB of storage Wink
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!